diff options
author | Ismaël Bouya <ismael.bouya@normalesup.org> | 2018-03-13 02:57:27 +0100 |
---|---|---|
committer | Ismaël Bouya <ismael.bouya@normalesup.org> | 2018-03-13 11:15:08 +0100 |
commit | 56bc60ea5e9ae11872d3e3d388adb7c5ada0c2c9 (patch) | |
tree | 6ad73e489addc7dbec280edab56f4f2c408d658e | |
parent | 70c37c94e226a708fd0407a4b3742c83972967a7 (diff) | |
download | Puppet-56bc60ea5e9ae11872d3e3d388adb7c5ada0c2c9.tar.gz Puppet-56bc60ea5e9ae11872d3e3d388adb7c5ada0c2c9.tar.zst Puppet-56bc60ea5e9ae11872d3e3d388adb7c5ada0c2c9.zip |
Add fstab module
-rw-r--r-- | environments/production/data/common.yaml | 1 | ||||
-rw-r--r-- | modules/base_installation/manifests/fstab.pp | 18 | ||||
-rw-r--r-- | modules/base_installation/manifests/init.pp | 2 | ||||
-rw-r--r-- | modules/base_installation/manifests/params.pp | 1 |
4 files changed, 22 insertions, 0 deletions
diff --git a/environments/production/data/common.yaml b/environments/production/data/common.yaml index 78cce6b..1b4f38d 100644 --- a/environments/production/data/common.yaml +++ b/environments/production/data/common.yaml | |||
@@ -7,6 +7,7 @@ base_installation::ldap_dn: "cn=%{facts.ec2_metadata.hostname},ou=hosts,dc=immae | |||
7 | base_installation::ldap_cn: "%{facts.ec2_metadata.hostname}" | 7 | base_installation::ldap_cn: "%{facts.ec2_metadata.hostname}" |
8 | base_installation::ldap_server: "ldap.immae.eu" | 8 | base_installation::ldap_server: "ldap.immae.eu" |
9 | base_installation::ldap_uri: "ldaps://ldap.immae.eu" | 9 | base_installation::ldap_uri: "ldaps://ldap.immae.eu" |
10 | base_installation::mounts: "%{alias('facts.ldapvar.self.vars.mounts')}" | ||
10 | base_installation::puppet_conf_path: "/etc/puppetlabs/puppet" | 11 | base_installation::puppet_conf_path: "/etc/puppetlabs/puppet" |
11 | base_installation::puppet_code_path: "/etc/puppetlabs/code" | 12 | base_installation::puppet_code_path: "/etc/puppetlabs/code" |
12 | base_installation::puppet_pass_seed: "/etc/puppetlabs/puppet/password_seed" | 13 | base_installation::puppet_pass_seed: "/etc/puppetlabs/puppet/password_seed" |
diff --git a/modules/base_installation/manifests/fstab.pp b/modules/base_installation/manifests/fstab.pp new file mode 100644 index 0000000..f012e76 --- /dev/null +++ b/modules/base_installation/manifests/fstab.pp | |||
@@ -0,0 +1,18 @@ | |||
1 | class base_installation::fstab ( | ||
2 | $mounts = $base_installation::mounts | ||
3 | ) inherits base_installation { | ||
4 | $mounts.each |$mount| { | ||
5 | unless empty($mount) { | ||
6 | $infos = split($mount, ';') | ||
7 | |||
8 | file { $infos[0]: | ||
9 | ensure => directory, | ||
10 | } -> | ||
11 | mount { $infos[0]: | ||
12 | ensure => mounted, | ||
13 | device => "UUID=${infos[1]}", | ||
14 | fstype => $infos[2] | ||
15 | } | ||
16 | } | ||
17 | } | ||
18 | } | ||
diff --git a/modules/base_installation/manifests/init.pp b/modules/base_installation/manifests/init.pp index 998f8ff..cb1cdda 100644 --- a/modules/base_installation/manifests/init.pp +++ b/modules/base_installation/manifests/init.pp | |||
@@ -6,6 +6,7 @@ class base_installation ( | |||
6 | Optional[String] $ldap_dn = $base_installation::params::ldap_dn, | 6 | Optional[String] $ldap_dn = $base_installation::params::ldap_dn, |
7 | Optional[String] $ldap_server = $base_installation::params::ldap_server, | 7 | Optional[String] $ldap_server = $base_installation::params::ldap_server, |
8 | Optional[String] $ldap_uri = $base_installation::params::ldap_uri, | 8 | Optional[String] $ldap_uri = $base_installation::params::ldap_uri, |
9 | Optional[Array[String]] $mounts = $base_installation::params::mounts, | ||
9 | Optional[String] $puppet_code_path = $base_installation::params::puppet_code_path, | 10 | Optional[String] $puppet_code_path = $base_installation::params::puppet_code_path, |
10 | Optional[String] $puppet_conf_path = $base_installation::params::puppet_conf_path, | 11 | Optional[String] $puppet_conf_path = $base_installation::params::puppet_conf_path, |
11 | Optional[String] $puppet_pass_seed = $base_installation::params::puppet_pass_seed, | 12 | Optional[String] $puppet_pass_seed = $base_installation::params::puppet_pass_seed, |
@@ -30,4 +31,5 @@ class base_installation ( | |||
30 | contain ::base_installation::users | 31 | contain ::base_installation::users |
31 | contain ::base_installation::package_managers | 32 | contain ::base_installation::package_managers |
32 | contain ::base_installation::puppet | 33 | contain ::base_installation::puppet |
34 | contain ::base_installation::fstab | ||
33 | } | 35 | } |
diff --git a/modules/base_installation/manifests/params.pp b/modules/base_installation/manifests/params.pp index 5ade838..2a9fe6a 100644 --- a/modules/base_installation/manifests/params.pp +++ b/modules/base_installation/manifests/params.pp | |||
@@ -10,6 +10,7 @@ class base_installation::params { | |||
10 | $ldap_cert_path = "/etc/ssl/certs/ca-certificates.crt" | 10 | $ldap_cert_path = "/etc/ssl/certs/ca-certificates.crt" |
11 | $ldap_uri = "ldaps://ldap.example.com" | 11 | $ldap_uri = "ldaps://ldap.example.com" |
12 | $ldap_server = "ldap.example.com" | 12 | $ldap_server = "ldap.example.com" |
13 | $mounts = [] | ||
13 | $real_hostname = "example.com" | 14 | $real_hostname = "example.com" |
14 | $system_hostname = "example.com" | 15 | $system_hostname = "example.com" |
15 | $system_locales = ["en_US.UTF-8"] | 16 | $system_locales = ["en_US.UTF-8"] |