diff options
Diffstat (limited to 'modules/role')
-rw-r--r-- | modules/role/manifests/cryptoportfolio.pp | 48 |
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 | } |