1
0
Fork 0
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:
James Antill 2026-03-24 17:25:19 -04:00
commit 68c02f4f1a

16
scripts/maint-update-reboot.sh Executable file
View 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