Skip to content

Commit 6bac026

Browse files
authored
Check for curl failure (#521)
When running the peadm::agent_install shell task, fail the task if the curl command fails.
1 parent b61dcd5 commit 6bac026

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Diff for: tasks/agent_install.sh

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
#!/bin/bash
22

33
set -e
4+
set -o pipefail
45

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

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

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

0 commit comments

Comments
 (0)