1 class base_installation::puppet (
2 $password_seed = $base_installation::puppet_pass_seed
3 ) inherits base_installation {
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",
16 ### Until puppet fixes hist gettext-setup gem use
17 package { 'gem:gettext-setup':
18 name => "gettext-setup",
21 install_options => "--no-user-install"
24 file { '/usr/lib/ruby/vendor_ruby/locales/':
26 target => "/opt/puppetlabs/puppet/share/locale/",
30 file { '/usr/local/sbin/i_puppet_lock':
33 source => "puppet:///modules/base_installation/scripts/puppet_lock"
36 file { '/usr/local/sbin/i_puppet_reset_and_apply':
39 source => "puppet:///modules/base_installation/scripts/puppet_reset_and_apply"
42 file { '/usr/local/sbin/i_puppet_report_print':
45 source => "puppet:///modules/base_installation/scripts/report_print.rb"
48 file { '/usr/local/sbin/puppet_apply':
51 source => "puppet:///modules/base_installation/scripts/puppet_apply",
54 unless empty(find_file($password_seed)) {
55 $ldap_password = generate_password(24, $password_seed, "ldap")
56 $ssha_ldap_seed = generate_password(5, $password_seed, "ldap_seed")
58 package { 'gem:ruby-ldap':
62 install_options => "--no-user-install"
65 package { 'gem:xmpp4r':
69 install_options => "--no-user-install"
72 file { $password_seed:
76 file { $base_installation::puppet_conf_path:
78 require => [Package["puppet5"], Package["gem:xmpp4r"], Package["gem:ruby-ldap"]],
84 $xmpp = lookup("base_installation::notify_xmpp", { "default_value" => {} })
85 $slack = lookup("base_installation::notify_slack", { "default_value" => {} })
87 file { "$base_installation::puppet_conf_path/puppet.conf":
88 content => template("base_installation/puppet/puppet.conf.erb"),
89 require => File[$base_installation::puppet_conf_path],
93 file { "$base_installation::puppet_conf_path/xmpp.yaml":
94 content => template("base_installation/puppet/xmpp.yaml.erb"),
95 require => File[$base_installation::puppet_conf_path],
99 unless empty($slack) {
100 file { "$base_installation::puppet_conf_path/slack.yaml":
101 content => template("base_installation/puppet/slack.yaml.erb"),
102 require => File[$base_installation::puppet_conf_path],
106 if file("$base_installation::puppet_notifies_path/host_ldap.info", "/dev/null") != "" and
107 empty($facts["ldapvar"]) {
108 fail("LDAP was activated but facts are not available")
111 file { $base_installation::puppet_notifies_path:
113 require => [Package["puppet5"], Package["gem:xmpp4r"], Package["gem:ruby-ldap"]],
119 $ips = lookup("ips", { 'default_value' => undef })
120 concat { "$base_installation::puppet_notifies_path/host_ldap.info":
123 require => File[$base_installation::puppet_notifies_path],
124 ensure_newline => true,
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"),
132 concat::fragment { "host_ldap add bottom":
133 target => "$base_installation::puppet_notifies_path/host_ldap.info",
138 concat::fragment { "host_ldap mod top":
139 target => "$base_installation::puppet_notifies_path/host_ldap.info",
140 content => template("base_installation/puppet/host_ldap_mod_top.info.erb"),
143 concat::fragment { "host_ldap mod bottom":
144 target => "$base_installation::puppet_notifies_path/host_ldap.info",