Skip to content

Commit 36bfd7b

Browse files
committed
Fail agent_install if agent is already installed
The PE bash installer script doesn't support re-configuring an existing agent, which is critical to our use case. Therefore, we should fail if the agent is already installed, since we cannot guarantee correct configuration in that scenario.
1 parent 53c8968 commit 36bfd7b

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

tasks/agent_install.sh

+5
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22

33
set -e
44

5+
if [ -x "/opt/puppetlabs/bin/puppet" ]; then
6+
echo "ERROR: Puppet agent is already installed. Re-install, re-configuration, or upgrade not supported. Please uninstall the agent before running this task."
7+
exit 1
8+
fi
9+
510
flags=$(echo $PT_install_flags | sed -e 's/^\["*//' -e 's/"*\]$//' -e 's/", *"/ /g')
611

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

0 commit comments

Comments
 (0)