From 300023f403f0f3d441ba9343c83776e542fb02cb Mon Sep 17 00:00:00 2001 From: Colleen Murphy Date: Sat, 24 Jun 2017 15:29:02 +0200 Subject: [PATCH] Fix beaker on xenial Update the spec helper to install puppet 3 from the Ubuntu repos instead of from puppetlabs. Change-Id: I42d5adc2f489d3b6b17fd8ce027c954cd9b3a59c --- spec/spec_helper_acceptance.rb | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/spec/spec_helper_acceptance.rb b/spec/spec_helper_acceptance.rb index 7a5efa1..002ab34 100644 --- a/spec/spec_helper_acceptance.rb +++ b/spec/spec_helper_acceptance.rb @@ -2,7 +2,14 @@ require 'beaker-rspec' hosts.each do |host| - install_puppet + # puppet 3 isn't available from apt.puppetlabs.com so install it from the Xenial repos + on host, "which apt-get && apt-get install puppet -y", { :acceptable_exit_codes => [0,1] } + # otherwise use the beaker helpers to install the yum.puppetlabs.com repo and puppet + r = on host, "which yum", { :acceptable_exit_codes => [0,1] } + if r.exit_code == 0 + install_puppet + end + add_platform_foss_defaults(host, 'unix') on host, "mkdir -p #{host['distmoduledir']}" end