|
1 | 1 | require 'beaker-rspec' |
2 | 2 | require 'beaker-puppet' |
3 | 3 | require 'beaker/module_install_helper' |
4 | | -require 'beaker/puppet_install_helper' |
5 | 4 | require 'voxpupuli/acceptance/spec_helper_acceptance' |
6 | 5 |
|
7 | 6 | $LOAD_PATH << File.join(__dir__, 'acceptance/lib') |
| 7 | +def run_puppet_install_helper |
| 8 | + return unless ENV['PUPPET_INSTALL_TYPE'] == 'agent' |
| 9 | + if ENV['BEAKER_PUPPET_COLLECTION'].match? %r{/-nightly$/} |
| 10 | + # Workaround for RE-10734 |
| 11 | + options[:release_apt_repo_url] = 'http://nightlies.puppet.com/apt' |
| 12 | + options[:win_download_url] = 'http://nightlies.puppet.com/downloads/windows' |
| 13 | + options[:mac_download_url] = 'http://nightlies.puppet.com/downloads/mac' |
| 14 | + end |
| 15 | + |
| 16 | + agent_sha = ENV['BEAKER_PUPPET_AGENT_SHA'] || ENV['PUPPET_AGENT_SHA'] |
| 17 | + if agent_sha.nil? || agent_sha.empty? |
| 18 | + install_puppet_agent_on(hosts, options.merge(version: version)) |
| 19 | + else |
| 20 | + # If we have a development sha, assume we're testing internally |
| 21 | + dev_builds_url = ENV['DEV_BUILDS_URL'] || 'http://builds.delivery.puppetlabs.net' |
| 22 | + install_from_build_data_url('puppet-agent', "#{dev_builds_url}/puppet-agent/#{agent_sha}/artifacts/#{agent_sha}.yaml", hosts) |
| 23 | + end |
| 24 | + |
| 25 | + # XXX install_puppet_agent_on() will only add_aio_defaults_on when the |
| 26 | + # nodeset type == 'aio', but we don't want to depend on that. |
| 27 | + add_aio_defaults_on(hosts) |
| 28 | + add_puppet_paths_on(hosts) |
| 29 | +end |
8 | 30 |
|
9 | 31 | hosts.each { |host| host[:type] = 'aio' } |
10 | 32 | run_puppet_install_helper unless ENV['BEAKER_provision'] == 'no' |
|
0 commit comments