Move SSH setup to its own role
Signed-off-by: Patrick Uiterwijk <puiterwijk@redhat.com>
This commit is contained in:
parent
0ad7549788
commit
e43e0e06b1
102 changed files with 21287 additions and 46 deletions
20
roles/basessh/files/common-scripts/conditional-restart.sh
Normal file
20
roles/basessh/files/common-scripts/conditional-restart.sh
Normal file
|
@ -0,0 +1,20 @@
|
|||
#!/bin/bash
|
||||
# Restart SERVICE only if PACKAGE is installed.
|
||||
# We use this throughout handlers/restart_services.yml
|
||||
|
||||
SERVICE=$1
|
||||
PACKAGE=$2
|
||||
|
||||
rpm -q $PACKAGE
|
||||
|
||||
INSTALLED=$?
|
||||
|
||||
if [ $INSTALLED -eq 0 ]; then
|
||||
echo "Package $PACKAGE installed. Attempting restart of $SERVICE."
|
||||
/sbin/service $SERVICE restart
|
||||
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 restart of $SERVICE."
|
||||
exit 0
|
Loading…
Add table
Add a link
Reference in a new issue