Setup a proxyreload for httpd that looks for the ticketkey. If it's not there, assume the proxy is just being configured and don't reload httpd.
This commit is contained in:
parent
181c1c7c32
commit
1effd347df
12 changed files with 47 additions and 19 deletions
25
roles/base/files/common-scripts/proxy-conditional-reload.sh
Normal file
25
roles/base/files/common-scripts/proxy-conditional-reload.sh
Normal file
|
@ -0,0 +1,25 @@
|
|||
#!/bin/bash
|
||||
# reload SERVICE only if PACKAGE is installed.
|
||||
# We use this throughout handlers/restart_services.yml
|
||||
|
||||
SERVICE=$1
|
||||
PACKAGE=$2
|
||||
|
||||
rpm -q $PACKAGE
|
||||
|
||||
INSTALLED=$?
|
||||
|
||||
if [ ! -f /etc/httpd/ticketkey_*.tkey ]; then
|
||||
# This host is not configured yet, do not try and restart httpd
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [ $INSTALLED -eq 0 ]; then
|
||||
echo "Package $PACKAGE installed. Attempting reload of $SERVICE."
|
||||
/sbin/service $SERVICE reload
|
||||
exit $? # Exit with the /sbin/service status code
|
||||
fi
|
||||
|
||||
# If the package wasn't installed, then pretend everything is fine.
|
||||
echo "Package $PACKAGE not installed. Skipping reload of $SERVICE."
|
||||
exit 0
|
Loading…
Add table
Add a link
Reference in a new issue