]>
Commit | Line | Data |
---|---|---|
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 | ||
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 | ||
30 | file { '/usr/local/sbin/i_puppet_reset_and_apply': | |
31 | mode => "0755", | |
32 | ensure => present, | |
33 | source => "puppet:///modules/base_installation/scripts/puppet_reset_and_apply" | |
34 | } | |
35 | ||
36 | file { '/usr/local/sbin/i_puppet_report_print': | |
37 | mode => "0755", | |
38 | ensure => present, | |
39 | source => "puppet:///modules/base_installation/scripts/report_print.rb" | |
40 | } | |
41 | ||
42 | file { '/usr/local/sbin/puppet_apply': | |
43 | mode => "0755", | |
44 | ensure => present, | |
45 | source => "puppet:///modules/base_installation/scripts/puppet_apply", | |
46 | } | |
47 | ||
48 | unless empty(find_file($password_seed)) { | |
49 | $ldap_password = generate_password(24, $password_seed, "ldap") | |
50 | $ssha_ldap_seed = generate_password(5, $password_seed, "ldap_seed") | |
51 | ||
52 | package { 'gem:ruby-ldap': | |
53 | name => "ruby-ldap", | |
54 | ensure => present, | |
55 | provider => "gem", | |
56 | install_options => "--no-user-install" | |
57 | } | |
58 | ||
59 | file { $password_seed: | |
60 | mode => "0600", | |
61 | } | |
62 | ||
63 | file { $base_installation::puppet_conf_path: | |
64 | ensure => directory, | |
65 | require => [Package["puppet"], Package["gem:ruby-ldap"]], | |
66 | recurse => true, | |
67 | purge => true, | |
68 | force => true, | |
69 | } | |
70 | ||
71 | file { "$base_installation::puppet_conf_path/puppet.conf": | |
72 | content => template("base_installation/puppet/puppet.conf.erb"), | |
73 | require => File[$base_installation::puppet_conf_path], | |
74 | } | |
75 | ||
76 | $ips = lookup("ips", { 'default_value' => undef }) | |
77 | file { "$base_installation::puppet_conf_path/host_ldap.info": | |
78 | content => template("base_installation/puppet/host_ldap.info.erb"), | |
79 | require => File[$base_installation::puppet_conf_path], | |
80 | notify => Notify_refresh["notify-ldap-password"], | |
81 | } | |
82 | ||
83 | notify_refresh { "notify-ldap-password": | |
84 | message => template("base_installation/puppet/host_ldap.info.erb"), | |
85 | refreshonly => true | |
86 | } | |
87 | } | |
88 | } |