Skip to content

Commit 09f9622

Browse files
committed
Fail peadm::pe_install task when installer fails
The peadm::pe_install task as written will probably never technically fail, even when the puppet-enterprise-installer script exits non-zero. This commit updates the task to exit with whatever exit code the puppet-enterprise-installer script exited with. Not a perfect fix but a step in the right direction. Fixes #71
1 parent ff5aff2 commit 09f9622

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

Diff for: tasks/pe_install.sh

+6
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ else
2626
/bin/bash "${tgzdir}/${pedir}/puppet-enterprise-installer" -y
2727
fi
2828

29+
# The exit code of the installer script will be the exit code of the task
30+
exit_code=$?
31+
2932
if [ "$PT_shortcircuit_puppetdb" = "true" ]; then
3033
systemctl stop pe-puppetdb.service
3134
rm /etc/systemd/system/pe-puppetdb.service.d/10-shortcircuit.conf
@@ -35,3 +38,6 @@ fi
3538
if [ "$PT_puppet_service_ensure" = "stopped" ]; then
3639
systemctl stop puppet.service
3740
fi
41+
42+
# Exit with the installer script's exit code
43+
exit $exit_code

0 commit comments

Comments
 (0)