diff --git a/playbooks/time-region-ntp.yml b/playbooks/time-region-ntp.yml index 62312e5..ffb198f 100644 --- a/playbooks/time-region-ntp.yml +++ b/playbooks/time-region-ntp.yml @@ -101,22 +101,18 @@ - ansible_facts['os_family'] == "RedHat" - rocky_add.changed or rocky_cleanup.changed - # ---------------------------------------------------------- - # PRINT TIME & NTP SOURCE + # ---------------------------------------------------------- + # PRINT TIME & NTP SOURCE (ZERO FAILURE SAFE) # ---------------------------------------------------------- - name: Read timedatectl status - ansible.builtin.command: timedatectl status + ansible.builtin.command: timedatectl register: timedate_output - - name: Print server time + NTP source + - name: Print time + time source for each server ansible.builtin.debug: msg: | === {{ inventory_hostname }} === - Current Time: {{ timedate_output.stdout | regex_search('Local time:\\s*(.*)', '\\1') }} - Timezone: {{ timedate_output.stdout | regex_search('Time zone:\\s*(.*)', '\\1') }} - NTP Source: {{ timedate_output.stdout | regex_search('System clock synchronized:\\s*(.*)', '\\1') }} - NTP Server: {{ timedate_output.stdout | regex_search('NTP service:\\s*(.*)', '\\1') }} - + {{ timedate_output.stdout }} # ---------------------------------------------------------- # FINAL SUMMARY # ----------------------------------------------------------