]>
Commit | Line | Data |
---|---|---|
54806111 IB |
1 | class base_installation::puppet ( |
2 | $password_seed = $base_installation::puppet_pass_seed | |
3 | ) inherits base_installation { | |
4 | File { | |
5 | mode => "0600", | |
6 | owner => "root", | |
7 | group => "root", | |
8 | } | |
9 | ||
10 | exec { 'generate_password_seed': | |
11 | command => "/usr/bin/openssl rand -base64 -out $password_seed 256", | |
12 | creates => $password_seed, | |
13 | environment => "RANDFILE=/dev/null", | |
14 | } | |
15 | ||
22e79acd IB |
16 | ### Until puppet fixes hist gettext-setup gem use |
17 | package { 'gem:gettext-setup': | |
18 | name => "gettext-setup", | |
19 | ensure => present, | |
20 | provider => "gem", | |
21 | install_options => "--no-user-install" | |
22 | } | |
23 | ||
24 | file { '/usr/lib/ruby/vendor_ruby/locales/': | |
25 | ensure => link, | |
26 | target => "/opt/puppetlabs/puppet/share/locale/", | |
27 | } | |
28 | ### | |
29 | ||
54806111 IB |
30 | unless empty(find_file($password_seed)) { |
31 | $ldap_password = generate_password(24, $password_seed, "ldap") | |
32 | $ssha_ldap_seed = generate_password(5, $password_seed, "ldap_seed") | |
33 | ||
34 | package { 'gem:ruby-ldap': | |
35 | name => "ruby-ldap", | |
36 | ensure => present, | |
37 | provider => "gem", | |
38 | install_options => "--no-user-install" | |
39 | } | |
40 | ||
41 | file { $password_seed: | |
42 | mode => "0600", | |
43 | } | |
44 | ||
45 | file { $base_installation::puppet_conf_path: | |
46 | ensure => directory, | |
47 | require => [Package["puppet"], Package["gem:ruby-ldap"]], | |
48 | recurse => true, | |
49 | purge => true, | |
50 | force => true, | |
51 | } | |
52 | ||
53 | file { "$base_installation::puppet_conf_path/puppet.conf": | |
54 | content => template("base_installation/puppet/puppet.conf.erb"), | |
55 | require => File[$base_installation::puppet_conf_path], | |
56 | } | |
57 | ||
51ab750f | 58 | $ips = lookup("ips") |$key| { {} } |
54806111 IB |
59 | file { "$base_installation::puppet_conf_path/host_ldap.info": |
60 | content => template("base_installation/puppet/host_ldap.info.erb"), | |
61 | require => File[$base_installation::puppet_conf_path], | |
62 | notify => Notify_refresh["notify-ldap-password"], | |
63 | } | |
64 | ||
65 | notify_refresh { "notify-ldap-password": | |
66 | message => template("base_installation/puppet/host_ldap.info.erb"), | |
67 | refreshonly => true | |
68 | } | |
69 | } | |
70 | } |