From a983f5e437093bedf654709ff78059ed75aabc2e Mon Sep 17 00:00:00 2001 From: Sean Millichamp Date: Mon, 28 Oct 2024 14:01:10 -0400 Subject: [PATCH] Check for curl failure When running the peadm::agent_install shell task, fail the task if the curl command fails. --- tasks/agent_install.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tasks/agent_install.sh b/tasks/agent_install.sh index b91d8035..79a7452a 100755 --- a/tasks/agent_install.sh +++ b/tasks/agent_install.sh @@ -1,6 +1,7 @@ #!/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." @@ -8,4 +9,4 @@ 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