|
8 | 8 | run_puppet_install_helper |
9 | 9 |
|
10 | 10 | hosts.each do |host| |
11 | | - if host['platform'] =~ /sles-12/i || host['platform'] =~ /solaris-11/i |
12 | | - apply_manifest_on(host, 'package{"git":}') |
13 | | - on host, 'git clone -b 4.6.x https://github.com/puppetlabs/puppetlabs-stdlib /etc/puppetlabs/puppet/modules/stdlib' |
| 11 | + # Solaris 11 doesn't ship the SSL CA root for the forgeapi server |
| 12 | + # therefore we need to use a different way to deploy the module to |
| 13 | + # the host |
| 14 | + if host['platform'] =~ /solaris-11/i |
| 15 | + apply_manifest_on(host, 'package { "git": }') |
| 16 | + # PE 3.x and 2015.2 require different locations to install modules |
| 17 | + modulepath = host.puppet['modulepath'] |
| 18 | + modulepath = modulepath.split(':').first if modulepath |
| 19 | + |
| 20 | + environmentpath = host.puppet['environmentpath'] |
| 21 | + environmentpath = environmentpath.split(':').first if environmentpath |
| 22 | + |
| 23 | + destdir = modulepath || "#{environmentpath}/production/modules" |
| 24 | + on host, "git clone -b 4.6.0 https://github.com/puppetlabs/puppetlabs-stdlib #{destdir}/stdlib" |
14 | 25 | else |
15 | | - on host, puppet('module install puppetlabs-stdlib'), {:acceptable_exit_codes => [0, 1]} |
| 26 | + on host, puppet('module install puppetlabs-stdlib') |
16 | 27 | end |
17 | 28 |
|
18 | | - #Need to disable update of ntp servers from DHCP, as subsequent restart of ntp causes test failures |
19 | | - if fact('osfamily') == 'Debian' |
20 | | - shell('[[ -f /etc/dhcp/dhclient-exit-hooks.d/ntp ]] && rm /etc/dhcp/dhcp-exit-hooks.d/ntp', { :acceptable_exit_codes => [0, 1] }) |
21 | | - shell('[[ -f /etc/dhcp3/dhclient-exit-hooks.d/ntp ]] && rm /etc/dhcp3/dhcp-exit-hooks.d/ntp', { :acceptable_exit_codes => [0, 1] }) |
22 | | - elsif fact('osfamily') == 'RedHat' |
23 | | - shell('echo "PEERNTP=no" >> /etc/sysconfig/network', { :acceptable_exit_codes => [0, 1]}) |
| 29 | + # Need to disable update of ntp servers from DHCP, as subsequent restart of ntp causes test failures |
| 30 | + if fact_on(host, 'osfamily') == 'Debian' |
| 31 | + on host, 'dpkg-divert --divert /etc/dhcp-ntp.bak --local --rename --add /etc/dhcp/dhclient-exit-hooks.d/ntp' |
| 32 | + on host, 'dpkg-divert --divert /etc/dhcp3-ntp.bak --local --rename --add /etc/dhcp3/dhclient-exit-hooks.d/ntp' |
| 33 | + elsif fact_on(host, 'osfamily') == 'RedHat' |
| 34 | + on host, 'echo "PEERNTP=no" >> /etc/sysconfig/network' |
24 | 35 | end |
25 | 36 | end |
26 | 37 | end |
|
0 commit comments