forked from infra/ansible
maint-update-reboot: Add script to update, maybe reboot maintainer_test hosts.
Signed-off-by: James Antill <james@and.org>
This commit is contained in:
parent
41f6c05954
commit
68c02f4f1a
1 changed files with 16 additions and 0 deletions
16
scripts/maint-update-reboot.sh
Executable file
16
scripts/maint-update-reboot.sh
Executable file
|
|
@ -0,0 +1,16 @@
|
|||
#! /bin/sh -e
|
||||
|
||||
for host in $(ansible maintainer_test --list-host | tail -n +2); do
|
||||
|
||||
echo " ======== Host: $host ========"
|
||||
|
||||
ssh "$host" dnf --refresh -y up
|
||||
|
||||
if [ "$(ssh $host who | wc -l)" = "1" ]; then
|
||||
ansible -m reboot "$host"
|
||||
ssh "$host" rkhunter --propupd
|
||||
else
|
||||
echo " ** Skipping reboot as Users on: $host"
|
||||
fi
|
||||
|
||||
done
|
||||
Loading…
Add table
Add a link
Reference in a new issue