diff options
Diffstat (limited to 'modules/base_installation/manifests')
-rw-r--r-- | modules/base_installation/manifests/init.pp | 33 | ||||
-rw-r--r-- | modules/base_installation/manifests/params.pp | 33 | ||||
-rw-r--r-- | modules/base_installation/manifests/puppet.pp | 42 |
3 files changed, 68 insertions, 40 deletions
diff --git a/modules/base_installation/manifests/init.pp b/modules/base_installation/manifests/init.pp index d8abcaf..a1b5ca8 100644 --- a/modules/base_installation/manifests/init.pp +++ b/modules/base_installation/manifests/init.pp | |||
@@ -1,20 +1,21 @@ | |||
1 | class base_installation ( | 1 | class base_installation ( |
2 | Optional[String] $grub_device = $base_installation::params::grub_device, | 2 | Optional[String] $grub_device = $base_installation::params::grub_device, |
3 | Optional[String] $ldap_base = $base_installation::params::ldap_base, | 3 | Optional[String] $ldap_base = $base_installation::params::ldap_base, |
4 | Optional[String] $ldap_cert_path = $base_installation::params::ldap_cert_path, | 4 | Optional[String] $ldap_cert_path = $base_installation::params::ldap_cert_path, |
5 | Optional[String] $ldap_cn = $base_installation::params::ldap_cn, | 5 | Optional[String] $ldap_cn = $base_installation::params::ldap_cn, |
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[String] $puppet_code_path = $base_installation::params::puppet_code_path, | 9 | Optional[String] $puppet_code_path = $base_installation::params::puppet_code_path, |
10 | Optional[String] $puppet_conf_path = $base_installation::params::puppet_conf_path, | 10 | Optional[String] $puppet_conf_path = $base_installation::params::puppet_conf_path, |
11 | Optional[String] $puppet_pass_seed = $base_installation::params::puppet_pass_seed, | 11 | Optional[String] $puppet_notifies_path = $base_installation::params::puppet_notifies_path, |
12 | Optional[String] $puppet_ssl_path = $base_installation::params::puppet_ssl_path, | 12 | Optional[String] $puppet_pass_seed = $base_installation::params::puppet_pass_seed, |
13 | Optional[String] $real_hostname = $base_installation::params::real_hostname, | 13 | Optional[String] $puppet_ssl_path = $base_installation::params::puppet_ssl_path, |
14 | Optional[String] $system_hostname = $base_installation::params::system_hostname, | 14 | Optional[String] $real_hostname = $base_installation::params::real_hostname, |
15 | Optional[Array[String]] $system_locales = $base_installation::params::system_locales, | 15 | Optional[String] $system_hostname = $base_installation::params::system_hostname, |
16 | Optional[String] $system_timezone = $base_installation::params::system_timezone, | 16 | Optional[Array[String]] $system_locales = $base_installation::params::system_locales, |
17 | Optional[Array[Hash]] $system_users = $base_installation::params::system_users, | 17 | Optional[String] $system_timezone = $base_installation::params::system_timezone, |
18 | Optional[Array[Hash]] $system_users = $base_installation::params::system_users, | ||
18 | ) inherits base_installation::params { | 19 | ) inherits base_installation::params { |
19 | contain ::base_installation::packages | 20 | contain ::base_installation::packages |
20 | contain ::base_installation::locales | 21 | contain ::base_installation::locales |
diff --git a/modules/base_installation/manifests/params.pp b/modules/base_installation/manifests/params.pp index 5ade838..f336b65 100644 --- a/modules/base_installation/manifests/params.pp +++ b/modules/base_installation/manifests/params.pp | |||
@@ -1,20 +1,21 @@ | |||
1 | class base_installation::params { | 1 | class base_installation::params { |
2 | $puppet_code_path = "/etc/puppetlabs/code" | 2 | $puppet_code_path = "/etc/puppetlabs/code" |
3 | $puppet_conf_path = "/etc/puppetlabs/puppet" | 3 | $puppet_conf_path = "/etc/puppetlabs/puppet" |
4 | $puppet_pass_seed = "/etc/puppetlabs/puppet/password_seed" | 4 | $puppet_notifies_path = "/etc/puppetlabs/notifies" |
5 | $puppet_ssl_path = "/etc/puppetlabs/ssl" | 5 | $puppet_pass_seed = "/etc/puppetlabs/puppet/password_seed" |
6 | $grub_device = "/dev/sda" | 6 | $puppet_ssl_path = "/etc/puppetlabs/ssl" |
7 | $ldap_base = "dc=example,dc=com" | 7 | $grub_device = "/dev/sda" |
8 | $ldap_cn = "node" | 8 | $ldap_base = "dc=example,dc=com" |
9 | $ldap_dn = "cn=node,ou=hosts,dc=example,dc=com" | 9 | $ldap_cn = "node" |
10 | $ldap_cert_path = "/etc/ssl/certs/ca-certificates.crt" | 10 | $ldap_dn = "cn=node,ou=hosts,dc=example,dc=com" |
11 | $ldap_uri = "ldaps://ldap.example.com" | 11 | $ldap_cert_path = "/etc/ssl/certs/ca-certificates.crt" |
12 | $ldap_server = "ldap.example.com" | 12 | $ldap_uri = "ldaps://ldap.example.com" |
13 | $real_hostname = "example.com" | 13 | $ldap_server = "ldap.example.com" |
14 | $system_hostname = "example.com" | 14 | $real_hostname = "example.com" |
15 | $system_locales = ["en_US.UTF-8"] | 15 | $system_hostname = "example.com" |
16 | $system_timezone = "UTC" | 16 | $system_locales = ["en_US.UTF-8"] |
17 | $system_users = [ | 17 | $system_timezone = "UTC" |
18 | $system_users = [ | ||
18 | { | 19 | { |
19 | userid => 1000, | 20 | userid => 1000, |
20 | username => "example", | 21 | username => "example", |
diff --git a/modules/base_installation/manifests/puppet.pp b/modules/base_installation/manifests/puppet.pp index 05fe9a1..603a961 100644 --- a/modules/base_installation/manifests/puppet.pp +++ b/modules/base_installation/manifests/puppet.pp | |||
@@ -103,21 +103,47 @@ class base_installation::puppet ( | |||
103 | } | 103 | } |
104 | } | 104 | } |
105 | 105 | ||
106 | if file("$base_installation::puppet_conf_path/host_ldap.info", "/dev/null") != "" and | 106 | if file("$base_installation::puppet_notifies_path/host_ldap.info", "/dev/null") != "" and |
107 | empty($facts["ldapvar"]) { | 107 | empty($facts["ldapvar"]) { |
108 | fail("LDAP was activated but facts are not available") | 108 | fail("LDAP was activated but facts are not available") |
109 | } | 109 | } |
110 | 110 | ||
111 | file { $base_installation::puppet_notifies_path: | ||
112 | ensure => directory, | ||
113 | require => [Package["puppet"], Package["gem:xmpp4r"], Package["gem:ruby-ldap"]], | ||
114 | recurse => true, | ||
115 | purge => true, | ||
116 | force => true, | ||
117 | } | ||
118 | |||
111 | $ips = lookup("ips", { 'default_value' => undef }) | 119 | $ips = lookup("ips", { 'default_value' => undef }) |
112 | file { "$base_installation::puppet_conf_path/host_ldap.info": | 120 | concat { "$base_installation::puppet_notifies_path/host_ldap.info": |
113 | content => template("base_installation/puppet/host_ldap.info.erb"), | 121 | ensure => "present", |
114 | require => File[$base_installation::puppet_conf_path], | 122 | mode => "0600", |
115 | notify => Notify_refresh["notify-ldap-password"], | 123 | require => File[$base_installation::puppet_notifies_path], |
124 | ensure_newline => true, | ||
125 | } | ||
126 | |||
127 | concat::fragment { "host_ldap add top": | ||
128 | target => "$base_installation::puppet_notifies_path/host_ldap.info", | ||
129 | content => template("base_installation/puppet/host_ldap_add_top.info.erb"), | ||
130 | order => "00-01", | ||
131 | } | ||
132 | concat::fragment { "host_ldap add bottom": | ||
133 | target => "$base_installation::puppet_notifies_path/host_ldap.info", | ||
134 | content => "EOF", | ||
135 | order => "00-99", | ||
116 | } | 136 | } |
117 | 137 | ||
118 | notify_refresh { "notify-ldap-password": | 138 | concat::fragment { "host_ldap mod top": |
119 | message => template("base_installation/puppet/host_ldap.info.erb"), | 139 | target => "$base_installation::puppet_notifies_path/host_ldap.info", |
120 | refreshonly => true | 140 | content => template("base_installation/puppet/host_ldap_mod_top.info.erb"), |
141 | order => "01-01", | ||
142 | } | ||
143 | concat::fragment { "host_ldap mod bottom": | ||
144 | target => "$base_installation::puppet_notifies_path/host_ldap.info", | ||
145 | content => "EOF", | ||
146 | order => "01-99", | ||
121 | } | 147 | } |
122 | } | 148 | } |
123 | } | 149 | } |