Update playbooks/time-region-ntp.yml

This commit is contained in:
2025-11-15 05:09:00 +00:00
parent d6d422d470
commit 114d5632d3
+4 -8
View File
@@ -102,21 +102,17 @@
- 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
# ----------------------------------------------------------