1
0
Fork 0
forked from infra/ansible
infra-ansible/scripts/maint-update-reboot.sh

16 lines
333 B
Bash
Raw Normal View History

#! /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 || true
else
echo " ** Skipping reboot as Users on: $host"
fi
done