mirror of
https://github.com/saltstack/salt.git
synced 2025-04-16 09:40:20 +00:00
Testing some ideas
This commit is contained in:
parent
665451d3cf
commit
161e23f3e5
2 changed files with 28 additions and 28 deletions
|
@ -18,23 +18,23 @@ case "$1" in
|
|||
fi
|
||||
chown -R $RET:$RET /etc/salt/pki/minion /etc/salt/minion.d /var/log/salt/minion /var/cache/salt/minion /var/run/salt/minion
|
||||
fi
|
||||
if command -v systemctl; then
|
||||
db_get salt-minion/active
|
||||
RESLT=$(echo "$RET" | cut -d ' ' -f 1)
|
||||
if [ "$RESLT" != 10 ]; then
|
||||
if [ "$RESLT" == "active" ]; then
|
||||
systemctl restart salt-minion
|
||||
fi
|
||||
db_get salt-minion/enabled
|
||||
if [ "$RESLT" == "disabled" ]; then
|
||||
systemctl disable salt-api
|
||||
else
|
||||
systemctl enable salt-api
|
||||
fi
|
||||
else
|
||||
systemctl restart salt-minion
|
||||
systemctl enable salt-minion
|
||||
fi
|
||||
fi
|
||||
## if command -v systemctl; then
|
||||
## db_get salt-minion/active
|
||||
## RESLT=$(echo "$RET" | cut -d ' ' -f 1)
|
||||
## if [ "$RESLT" != 10 ]; then
|
||||
## if [ "$RESLT" == "active" ]; then
|
||||
## systemctl restart salt-minion
|
||||
## fi
|
||||
## db_get salt-minion/enabled
|
||||
## if [ "$RESLT" == "disabled" ]; then
|
||||
## systemctl disable salt-api
|
||||
## else
|
||||
## systemctl enable salt-api
|
||||
## fi
|
||||
## else
|
||||
## systemctl restart salt-minion
|
||||
## systemctl enable salt-minion
|
||||
## fi
|
||||
## fi
|
||||
;;
|
||||
esac
|
||||
|
|
|
@ -20,15 +20,15 @@ case "$1" in
|
|||
db_set salt-minion/user $CUR_USER
|
||||
chown -R $CUR_USER:$CUR_GROUP /etc/salt/pki/minion /etc/salt/minion.d /var/log/salt/minion \
|
||||
/var/cache/salt/minion /var/run/salt/minion
|
||||
if command -v systemctl; then
|
||||
SM_ENABLED=$(systemctl show -p UnitFileState salt-minion | cut -d '=' -f 2)
|
||||
db_set salt-minion/enabled $SM_ENABLED
|
||||
SM_ACTIVE=$(systemctl is-active salt-minion)
|
||||
db_set salt-minion/active $SM_ACTIVE
|
||||
else
|
||||
db_set salt-minion/enabled enabled
|
||||
db_set salt-minion/active active
|
||||
|
||||
fi
|
||||
## if command -v systemctl; then
|
||||
## SM_ENABLED=$(systemctl show -p UnitFileState salt-minion | cut -d '=' -f 2)
|
||||
## db_set salt-minion/enabled $SM_ENABLED
|
||||
## SM_ACTIVE=$(systemctl is-active salt-minion)
|
||||
## db_set salt-minion/active $SM_ACTIVE
|
||||
## else
|
||||
## db_set salt-minion/enabled enabled
|
||||
## db_set salt-minion/active active
|
||||
##
|
||||
## fi
|
||||
;;
|
||||
esac
|
||||
|
|
Loading…
Add table
Reference in a new issue