From 87d67b292b9c65d784e91e5d8ff34d0eddc4f65d Mon Sep 17 00:00:00 2001 From: Michael Hashizume Date: Mon, 8 Jul 2024 15:57:16 -0700 Subject: [PATCH] acceptance/helpers.rb: add signed-by to apt sources.list --- acceptance/helpers.rb | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/acceptance/helpers.rb b/acceptance/helpers.rb index 96af946a..55f0efc7 100644 --- a/acceptance/helpers.rb +++ b/acceptance/helpers.rb @@ -235,6 +235,15 @@ def set_up_initial_agent_on(host, initial_package_version_or_collection) end install_puppet_agent_on(host, agent_install_options) + + # beaker-puppet doesn't add signing information to the apt source list, but this module does. + # This discrepancy causes apt to error, so we manually add signing info. + if %r{debian|ubuntu}.match?(host['platform']) + step '(Agent) Add apt signing information' do + on(host, "sed -e 's/^deb http/deb [signed-by=\\/etc\\/apt\\/keyrings\\/GPG-KEY-puppet-20250406.asc] http/' /etc/apt/sources.list.d/puppet*.list -i") + end + end + teardowns << -> do remove_installed_agent(host) end