aboutsummaryrefslogtreecommitdiff
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
parentf67c5285ae3847366129228576a1b41aad7cf05d (diff)
downloadPuppet-76a321e1b7da9f122f35a9722d9f8f331b06f8aa.tar.gz
Puppet-76a321e1b7da9f122f35a9722d9f8f331b06f8aa.tar.zst
Puppet-76a321e1b7da9f122f35a9722d9f8f331b06f8aa.zip
Create cryptoportfolio user
-rw-r--r--.gitmodules4
-rw-r--r--environments/production/data/nodes/vps494082.yaml2
m---------modules/archive0
-rw-r--r--modules/role/manifests/cryptoportfolio.pp48
4 files changed, 53 insertions, 1 deletions
diff --git a/.gitmodules b/.gitmodules
index 8071288..e893f13 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -34,7 +34,9 @@
34[submodule "modules/nginx"] 34[submodule "modules/nginx"]
35 path = modules/nginx 35 path = modules/nginx
36 url = git://git.immae.eu/github/voxpupuli/puppet-nginx.git 36 url = git://git.immae.eu/github/voxpupuli/puppet-nginx.git
37[submodule "modules/archive"]
38 path = modules/archive
39 url = git://git.immae.eu/github/voxpupuli/puppet-archive.git
37[submodule "python/ovh"] 40[submodule "python/ovh"]
38 path = python/ovh 41 path = python/ovh
39 url = git://git.immae.eu/github/ovh/python-ovh 42 url = git://git.immae.eu/github/ovh/python-ovh
40
diff --git a/environments/production/data/nodes/vps494082.yaml b/environments/production/data/nodes/vps494082.yaml
index 1e14c8f..e9f2e54 100644
--- a/environments/production/data/nodes/vps494082.yaml
+++ b/environments/production/data/nodes/vps494082.yaml
@@ -1 +1,3 @@
1base_installation::system_hostname: cryptoportfolio.immae.eu 1base_installation::system_hostname: cryptoportfolio.immae.eu
2cryptoportfolio::front_version: v0.0.1
3cryptoportfolio::front_sha256: 1a2ec0d1d2b4c3efa7f7cae063c55dda174d058f31d8b6fb50f76492061d37f3
diff --git a/modules/archive b/modules/archive
new file mode 160000
Subproject 9af5cad2bbaafe0498032c38a37835e4ccba7d2
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}