Skip to content

Commit

Permalink
Check for curl failure
Browse files Browse the repository at this point in the history
When running the peadm::agent_install shell task, fail the
task if the curl command fails.
  • Loading branch information
seanmil committed Oct 28, 2024
1 parent b61dcd5 commit a983f5e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tasks/agent_install.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
#!/bin/bash

set -e
set -o pipefail

if [ -x "/opt/puppetlabs/bin/puppet" ]; then
echo "WARNING: Puppet agent is already installed. Re-install, re-configuration, or upgrade not supported and might fail."
fi

flags=$(echo "$PT_install_flags" | sed -e 's/^\["*//' -e 's/"*\]$//' -e 's/", *"/ /g')

curl -k "https://${PT_server}:8140/packages/current/install.bash" | bash -s -- $flags
curl --fail -k "https://${PT_server}:8140/packages/current/install.bash" | bash -s -- $flags

0 comments on commit a983f5e

Please sign in to comment.