aboutsummaryrefslogtreecommitdiff
path: root/modules/role
diff options
context:
space:
mode:
authorIsmaël Bouya <ismael.bouya@normalesup.org>2018-02-18 15:02:03 +0100
committerIsmaël Bouya <ismael.bouya@normalesup.org>2018-02-18 19:28:36 +0100
commit76a321e1b7da9f122f35a9722d9f8f331b06f8aa (patch)
tree748417eb050bc2b2f1e02705a92ba9f4067dc720 /modules/role
parentf67c5285ae3847366129228576a1b41aad7cf05d (diff)
downloadPuppet-76a321e1b7da9f122f35a9722d9f8f331b06f8aa.tar.gz
Puppet-76a321e1b7da9f122f35a9722d9f8f331b06f8aa.tar.zst
Puppet-76a321e1b7da9f122f35a9722d9f8f331b06f8aa.zip
Create cryptoportfolio user
Diffstat (limited to 'modules/role')
-rw-r--r--modules/role/manifests/cryptoportfolio.pp48
1 files changed, 48 insertions, 0 deletions
diff --git a/modules/role/manifests/cryptoportfolio.pp b/modules/role/manifests/cryptoportfolio.pp
index 4643f9e..046b79e 100644
--- a/modules/role/manifests/cryptoportfolio.pp
+++ b/modules/role/manifests/cryptoportfolio.pp
@@ -35,4 +35,52 @@ class role::cryptoportfolio {
35 } 35 }
36 36
37 ensure_packages(["go", "npm", "nodejs", "yarn"]) 37 ensure_packages(["go", "npm", "nodejs", "yarn"])
38
39 user { "cryptoportfolio":
40 name => "cryptoportfolio",
41 ensure => "present",
42 managehome => true,
43 home => "/opt/cryptoportfolio",
44 system => true,
45 password => '!!',
46 }
47
48 $front_version = lookup("cryptoportfolio::front_version") |$key| { {} }
49 $front_sha256 = lookup("cryptoportfolio::front_sha256") |$key| { {} }
50
51 unless empty($front_version) {
52 file { "/opt/cryptoportfolio/front":
53 ensure => directory,
54 mode => "0700",
55 owner => "cryptoportfolio",
56 group => "cryptoportfolio",
57 }
58
59 file { "/opt/cryptoportfolio/front/${front_version}":
60 ensure => directory,
61 mode => "0700",
62 owner => "cryptoportfolio",
63 group => "cryptoportfolio",
64 require => File["/opt/cryptoportfolio/front"],
65 }
66
67 archive { "/opt/cryptoportfolio/front/${front_version}.tar.gz":
68 path => "/opt/cryptoportfolio/front/${front_version}.tar.gz",
69 source => "https://git.immae.eu/releases/cryptoportfolio/front/front_${front_version}.tar.gz",
70 creates => "/opt/cryptoportfolio/front/${front_version}/README.md",
71 checksum_type => "sha256",
72 checksum => $front_sha256,
73 cleanup => false,
74 extract => true,
75 extract_path => "/opt/cryptoportfolio/front/${front_version}",
76 require => File["/opt/cryptoportfolio/front/${front_version}"],
77 }
78
79 file { "/opt/cryptoportfolio/front/current":
80 ensure => "link",
81 target => "/opt/cryptoportfolio/front/${front_version}",
82 require => Archive["/opt/cryptoportfolio/front/${front_version}.tar.gz"]
83 }
84 }
85
38} 86}