From c4194c2511d422a129593d9aef7387627c4d2568 Mon Sep 17 00:00:00 2001 From: Lukas Audzevicius Date: Wed, 3 Dec 2025 11:39:00 +0000 Subject: [PATCH] (CAT-2476) Address SLES agent installation failure Fix SLES agent installation issues by ensuring /etc/zypp/credentials.d/PuppetcoreCreds exists The puppet_agent install_shell.sh task silently fails on SLES systems when the PuppetcoreCreds file is missing. This fix touches the required file before running the agent installation task on SLES targets. --- lib/puppet_litmus/rake_helper.rb | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/lib/puppet_litmus/rake_helper.rb b/lib/puppet_litmus/rake_helper.rb index 84726af..83baec9 100644 --- a/lib/puppet_litmus/rake_helper.rb +++ b/lib/puppet_litmus/rake_helper.rb @@ -143,8 +143,19 @@ def install_agent(collection, targets, inventory_hash) raise 'puppetcore agent installs require a valid PUPPET_FORGE_TOKEN set in the env.' \ if collection =~ /\Apuppetcore.*/ && !forge_token + # Fix for SLES systems - ensure credentials file exists before agent installation + targets.each do |target| + node_facts = facts_from_node(inventory_hash, target) + next unless node_facts && node_facts['platform'] =~ /sles/i + + result = run_command('touch /etc/zypp/credentials.d/PuppetcoreCreds', + target, config: DEFAULT_CONFIG_DATA, inventory: inventory_hash.clone) + raise_bolt_errors(result, "Failed to create Puppet credentials file on SLES target #{target}.") + end + # using boltspec, when the runner is called it changes the inventory_hash dropping the version field. The clone works around this bolt_result = run_task('puppet_agent::install', targets, params, config: DEFAULT_CONFIG_DATA, inventory: inventory_hash.clone) + targets.each do |target| params = { 'path' => '/opt/puppetlabs/bin'