|
14 | 14 |
|
15 | 15 | hosts.each do |host| |
16 | 16 | on hosts, "mkdir -p #{host['distmoduledir']}" |
| 17 | + if host['platform'] =~ /sles-1/i || host['platform'] =~ /solaris-1/i |
| 18 | + get_stdlib = <<-EOS |
| 19 | + package{'wget':} |
| 20 | + exec{'download': |
| 21 | + command => "wget -P /root/ https://forgeapi.puppetlabs.com/v3/files/puppetlabs-stdlib-4.3.2.tar.gz --no-check-certificate", |
| 22 | + path => ['/opt/csw/bin/','/usr/bin/'] |
| 23 | + } |
| 24 | + EOS |
| 25 | + apply_manifest_on(host, get_stdlib) |
| 26 | + # have to use force otherwise it checks ssl cert even though it is a local file |
| 27 | + on host, puppet('module install /root/puppetlabs-stdlib-4.3.2.tar.gz --force --ignore-dependencies'), {:acceptable_exit_codes => [0, 1]} |
| 28 | + elsif host['platform'] =~ /windows/i |
| 29 | + on host, shell('curl -k -o c:/cygwin64/home/Administrator/puppetlabs-stdlib-4.3.2.tar.gz https://forgeapi.puppetlabs.com/v3/files/puppetlabs-stdlib-4.3.2.tar.gz') |
| 30 | + on host, puppet('module install c:/cygwin64/home/Administrator/puppetlabs-stdlib-4.3.2.tar.gz --force --ignore-dependencies') |
| 31 | + else |
| 32 | + on host, puppet('module install puppetlabs-stdlib'), {:acceptable_exit_codes => [0, 1]} |
| 33 | + end |
17 | 34 | end |
18 | 35 | end |
19 | 36 |
|
|
26 | 43 |
|
27 | 44 | # Configure all nodes in nodeset |
28 | 45 | c.before :suite do |
29 | | - # Install module and dependencies |
30 | 46 | hosts.each do |host| |
31 | | - if fact_on(host, 'osfamily') == 'windows' |
32 | | - pp = <<EOS |
33 | | - exec{'download-cert': |
34 | | - path => ['C:\Windows\System32\WindowsPowershell\v1.0','C:\Windows\Sysnative\WindowsPowershell\v1.0'], |
35 | | - command => 'powershell.exe -command "(New-Object System.Net.Webclient).DownloadString(\"https://forge.puppetlabs.com\")"', |
36 | | - } |
37 | | -EOS |
38 | | - apply_manifest_on(host, pp) |
39 | | - end |
40 | | - |
41 | | - on host, "mkdir -p #{host['distmoduledir']}/concat" |
42 | | - result = on host, "echo #{host['distmoduledir']}/concat" |
43 | | - target = result.raw_output.chomp |
44 | | - |
45 | | - %w(files lib manifests metadata.json).each do |file| |
46 | | - scp_to host, "#{proj_root}/#{file}", target |
47 | | - end |
48 | | - #copy_module_to(host, :source => proj_root, :module_name => 'concat') |
49 | | - on host, puppet('module', 'install', 'puppetlabs-stdlib'), {:acceptable_exit_codes => [0, 1]} |
| 47 | + copy_module_to(host, :source => proj_root, :module_name => 'concat') |
50 | 48 | end |
51 | 49 | end |
52 | 50 |
|
|
0 commit comments