From 45baa7c54cf8e2b21ac8d10f423e6b3ddbe26440 Mon Sep 17 00:00:00 2001 From: admingit Date: Thu, 3 Aug 2023 19:03:19 +0200 Subject: [PATCH] add_reboot --- Deleted_SplunkForwarder.yml | 26 ++++++++++++++++++++++---- Deleted_SplunkHeavyForwarder.yml | 27 ++++++++++++++++++++++----- 2 files changed, 44 insertions(+), 9 deletions(-) diff --git a/Deleted_SplunkForwarder.yml b/Deleted_SplunkForwarder.yml index ecdcd20..6609c04 100644 --- a/Deleted_SplunkForwarder.yml +++ b/Deleted_SplunkForwarder.yml @@ -33,7 +33,25 @@ - /etc/systemd/system/Splunk.service - name: "Shutdown VM" - reboot: - reboot_timeout: 300 - async: 0 - poll: 0 + shell: shutdown -r now + + - name: Wait for the reboot and reconnect + wait_for: + port: 22 + search_regex: OpenSSH + delay: 10 + timeout: 60 + connection: local + + - name: Check the Uptime of the servers + shell: "uptime" + register: Uptime + + - debug: var=Uptime + + + #- name: "Shutdown VM" + #reboot: + #reboot_timeout: 300 + #async: 0 + #poll: 0 diff --git a/Deleted_SplunkHeavyForwarder.yml b/Deleted_SplunkHeavyForwarder.yml index bc7c489..c7a7c7f 100644 --- a/Deleted_SplunkHeavyForwarder.yml +++ b/Deleted_SplunkHeavyForwarder.yml @@ -31,9 +31,26 @@ with_items: - /etc/init.d/splunk - /etc/systemd/system/splunk.service - + - name: "Shutdown VM" - reboot: - reboot_timeout: 300 - async: 0 - poll: 0 + shell: shutdown -r now + + - name: Wait for the reboot and reconnect + wait_for: + port: 22 + search_regex: OpenSSH + delay: 10 + timeout: 60 + connection: local + + - name: Check the Uptime of the servers + shell: "uptime" + register: Uptime + + - debug: var=Uptime + + #- name: "Shutdown VM" + #reboot: + #reboot_timeout: 300 + #async: 0 + #poll: 0