diff options
Diffstat (limited to 'modules/base_installation/manifests/puppet.pp')
-rw-r--r-- | modules/base_installation/manifests/puppet.pp | 110 |
1 files changed, 58 insertions, 52 deletions
diff --git a/modules/base_installation/manifests/puppet.pp b/modules/base_installation/manifests/puppet.pp index 603a961..8040017 100644 --- a/modules/base_installation/manifests/puppet.pp +++ b/modules/base_installation/manifests/puppet.pp | |||
@@ -52,21 +52,25 @@ class base_installation::puppet ( | |||
52 | } | 52 | } |
53 | 53 | ||
54 | unless empty(find_file($password_seed)) { | 54 | unless empty(find_file($password_seed)) { |
55 | $ldap_password = generate_password(24, $password_seed, "ldap") | 55 | if ($base_installation::ldap_enabled) { |
56 | $ssha_ldap_seed = generate_password(5, $password_seed, "ldap_seed") | 56 | $ldap_password = generate_password(24, $password_seed, "ldap") |
57 | 57 | $ssha_ldap_seed = generate_password(5, $password_seed, "ldap_seed") | |
58 | package { 'gem:ruby-ldap': | 58 | |
59 | name => "ruby-ldap", | 59 | package { 'gem:ruby-ldap': |
60 | ensure => present, | 60 | name => "ruby-ldap", |
61 | provider => "gem", | 61 | ensure => present, |
62 | install_options => "--no-user-install" | 62 | provider => "gem", |
63 | } | 63 | install_options => "--no-user-install", |
64 | before => File["$base_installation::puppet_conf_path"] | ||
65 | } | ||
64 | 66 | ||
65 | package { 'gem:xmpp4r': | 67 | package { 'gem:xmpp4r': |
66 | name => "xmpp4r", | 68 | name => "xmpp4r", |
67 | ensure => present, | 69 | ensure => present, |
68 | provider => "gem", | 70 | provider => "gem", |
69 | install_options => "--no-user-install" | 71 | install_options => "--no-user-install", |
72 | before => File["$base_installation::puppet_conf_path"] | ||
73 | } | ||
70 | } | 74 | } |
71 | 75 | ||
72 | file { $password_seed: | 76 | file { $password_seed: |
@@ -75,7 +79,7 @@ class base_installation::puppet ( | |||
75 | 79 | ||
76 | file { $base_installation::puppet_conf_path: | 80 | file { $base_installation::puppet_conf_path: |
77 | ensure => directory, | 81 | ensure => directory, |
78 | require => [Package["puppet"], Package["gem:xmpp4r"], Package["gem:ruby-ldap"]], | 82 | require => [Package["puppet"]], |
79 | recurse => true, | 83 | recurse => true, |
80 | purge => true, | 84 | purge => true, |
81 | force => true, | 85 | force => true, |
@@ -103,47 +107,49 @@ class base_installation::puppet ( | |||
103 | } | 107 | } |
104 | } | 108 | } |
105 | 109 | ||
106 | if file("$base_installation::puppet_notifies_path/host_ldap.info", "/dev/null") != "" and | 110 | if ($base_installation::ldap_enabled) { |
107 | empty($facts["ldapvar"]) { | 111 | if file("$base_installation::puppet_notifies_path/host_ldap.info", "/dev/null") != "" and |
108 | fail("LDAP was activated but facts are not available") | 112 | empty($facts["ldapvar"]) { |
109 | } | 113 | fail("LDAP was activated but facts are not available") |
114 | } | ||
110 | 115 | ||
111 | file { $base_installation::puppet_notifies_path: | 116 | file { $base_installation::puppet_notifies_path: |
112 | ensure => directory, | 117 | ensure => directory, |
113 | require => [Package["puppet"], Package["gem:xmpp4r"], Package["gem:ruby-ldap"]], | 118 | require => [Package["puppet"], Package["gem:xmpp4r"], Package["gem:ruby-ldap"]], |
114 | recurse => true, | 119 | recurse => true, |
115 | purge => true, | 120 | purge => true, |
116 | force => true, | 121 | force => true, |
117 | } | 122 | } |
118 | 123 | ||
119 | $ips = lookup("ips", { 'default_value' => undef }) | 124 | $ips = lookup("ips", { 'default_value' => undef }) |
120 | concat { "$base_installation::puppet_notifies_path/host_ldap.info": | 125 | concat { "$base_installation::puppet_notifies_path/host_ldap.info": |
121 | ensure => "present", | 126 | ensure => "present", |
122 | mode => "0600", | 127 | mode => "0600", |
123 | require => File[$base_installation::puppet_notifies_path], | 128 | require => File[$base_installation::puppet_notifies_path], |
124 | ensure_newline => true, | 129 | ensure_newline => true, |
125 | } | 130 | } |
126 | 131 | ||
127 | concat::fragment { "host_ldap add top": | 132 | concat::fragment { "host_ldap add top": |
128 | target => "$base_installation::puppet_notifies_path/host_ldap.info", | 133 | target => "$base_installation::puppet_notifies_path/host_ldap.info", |
129 | content => template("base_installation/puppet/host_ldap_add_top.info.erb"), | 134 | content => template("base_installation/puppet/host_ldap_add_top.info.erb"), |
130 | order => "00-01", | 135 | order => "00-01", |
131 | } | 136 | } |
132 | concat::fragment { "host_ldap add bottom": | 137 | concat::fragment { "host_ldap add bottom": |
133 | target => "$base_installation::puppet_notifies_path/host_ldap.info", | 138 | target => "$base_installation::puppet_notifies_path/host_ldap.info", |
134 | content => "EOF", | 139 | content => "EOF", |
135 | order => "00-99", | 140 | order => "00-99", |
136 | } | 141 | } |
137 | 142 | ||
138 | concat::fragment { "host_ldap mod top": | 143 | concat::fragment { "host_ldap mod top": |
139 | target => "$base_installation::puppet_notifies_path/host_ldap.info", | 144 | target => "$base_installation::puppet_notifies_path/host_ldap.info", |
140 | content => template("base_installation/puppet/host_ldap_mod_top.info.erb"), | 145 | content => template("base_installation/puppet/host_ldap_mod_top.info.erb"), |
141 | order => "01-01", | 146 | order => "01-01", |
142 | } | 147 | } |
143 | concat::fragment { "host_ldap mod bottom": | 148 | concat::fragment { "host_ldap mod bottom": |
144 | target => "$base_installation::puppet_notifies_path/host_ldap.info", | 149 | target => "$base_installation::puppet_notifies_path/host_ldap.info", |
145 | content => "EOF", | 150 | content => "EOF", |
146 | order => "01-99", | 151 | order => "01-99", |
152 | } | ||
147 | } | 153 | } |
148 | } | 154 | } |
149 | } | 155 | } |