|
12 | 12 | hosts.each do |host|
|
13 | 13 | # Install puppet
|
14 | 14 | install_puppet()
|
15 |
| - |
16 | 15 | osfamily = on(host, facter('osfamily')).stdout.strip
|
| 16 | + osrelease = on(host, facter('operatingsystemmajrelease')).stdout.strip |
17 | 17 |
|
18 | 18 | puppet_module_install(:source => proj_root, :module_name => 'puppet')
|
19 | 19 | # Install dependencies from Modulefile
|
20 | 20 | shell("echo '127.0.0.1 master.test.local' >> /etc/hosts")
|
21 | 21 | shell('hostname master.test.local')
|
22 |
| - shell('puppet module install puppetlabs-inifile') |
23 |
| - shell('puppet module install puppetlabs-apache') |
24 |
| - shell('puppet module install puppetlabs-puppetdb') |
25 |
| - shell('puppet module install puppetlabs-stdlib') |
| 22 | + on host, puppet('module', 'install', 'puppetlabs-inifile'), { :acceptable_exit_codes => [0,1] } |
| 23 | + on host, puppet('module', 'install', 'puppetlabs-apache'), { :acceptable_exit_codes => [0,1] } |
| 24 | + on host, puppet('module', 'install', 'puppetlabs-puppetdb'), { :acceptable_exit_codes => [0,1] } |
| 25 | + on host, puppet('module', 'install', 'puppetlabs-stdlib'), { :acceptable_exit_codes => [0,1] } |
26 | 26 | if osfamily == 'Debian'
|
27 | 27 | shell('puppet module install puppetlabs-apt')
|
28 | 28 | end
|
29 | 29 | # puppetlabs-apache requires EPEL for mod_passenger
|
30 | 30 | if osfamily == 'RedHat'
|
31 |
| - shell('puppet module install stahnma-epel') |
32 |
| - apply_manifest_on agent, 'class {"epel": }', { :catch_failures => true } |
| 31 | + on host, puppet('module', 'install', 'stahnma-epel'), { :acceptable_exit_codes => [0,1] } |
| 32 | + on host, puppet('apply', '-e', '"class {epel:}"'), { :acceptable_exit_codes => [0] } |
| 33 | + shell("rpm -iv http://yum.theforeman.org/releases/latest/el#{osrelease}/x86_64/foreman-release.rpm") |
33 | 34 | end
|
34 | 35 | end
|
35 | 36 | end
|
|
0 commit comments