lib/beaker-pe/install/pe_utils.rb in beaker-pe-0.5.0 vs lib/beaker-pe/install/pe_utils.rb in beaker-pe-0.6.0

- old
+ new

@@ -350,10 +350,15 @@ hosts_agent_only, hosts_not_agent_only = create_agent_specified_arrays(hosts) else hosts_agent_only, hosts_not_agent_only = [], hosts.dup end + # On July 8th, 2016, the GPG key used to sign repos inside PE tarballs + # expired. Add a temporary, extended key to the host first so that it + # can still install those old PE tarballs. + add_extended_gpg_key_to_hosts(hosts, opts) + # Set PE distribution for all the hosts, create working dir use_all_tar = ENV['PE_USE_ALL_TAR'] == 'true' hosts.each do |host| next if agent_only_check_needed && hosts_agent_only.include?(host) host['pe_installer'] ||= 'puppet-enterprise-installer' @@ -512,9 +517,29 @@ end # True if version is greater than or equal to MEEP_CUTOVER_VERSION (2016.2.0) def use_meep?(version) !version_is_less(version, MEEP_CUTOVER_VERSION) + end + + # On July 8th, 2016, the gpg key that was shipped and used to sign repos in + # PE tarballs expired. This affects all PE version earlier then 3.8.5, and + # versions between 2015.2 to 2016.1.2. + # + # PE 3.8.5 and 2016.1.2 shipped with a version of the key that had it's + # expiration date extended by 6 months (to Janurary 2017). + def add_extended_gpg_key_to_hosts(hosts, opts) + hosts.each do |host| + # RPM based platforms do not seem to be effected by an expired GPG key, + # while deb based platforms are failing. + if host['platform'] =~ /debian|ubuntu/ + host_ver = host['pe_ver'] || opts['pe_ver'] + + if version_is_less(host_ver, '3.8.5') || (!version_is_less(host_ver, '2015.2.0') && version_is_less(host_ver, '2016.1.2')) + on(host, 'curl http://apt.puppetlabs.com/pubkey.gpg | apt-key add -') + end + end + end end # Set installer options on the passed *host* according to current # version. #