diff --git a/Maintenance/maint-reboot-required.yaml b/Maintenance/maint-reboot-required.yaml index efef12b..0073014 100644 --- a/Maintenance/maint-reboot-required.yaml +++ b/Maintenance/maint-reboot-required.yaml @@ -16,12 +16,18 @@ - name: Wait for systems to become reachable wait_for_connection: - delay: 30 + delay: 5 timeout: 300 - name: Get list of rebooted servers set_fact: - rebooted_servers: "{{ groups['all'] | intersect([host for host, result in reboot.items() if result.stat.exists]) }}" + rebooted_servers: [] + when: not reboot.stat.exists + + - name: Add server to rebooted_servers list + set_fact: + rebooted_servers: "{{ rebooted_servers + [ansible_host] }}" + when: reboot.stat.exists - name: Debug rebooted servers debug: