Update playbooks/time-region-ntp.yml
This commit is contained in:
@@ -102,21 +102,17 @@
|
|||||||
- rocky_add.changed or rocky_cleanup.changed
|
- rocky_add.changed or rocky_cleanup.changed
|
||||||
|
|
||||||
# ----------------------------------------------------------
|
# ----------------------------------------------------------
|
||||||
# PRINT TIME & NTP SOURCE
|
# PRINT TIME & NTP SOURCE (ZERO FAILURE SAFE)
|
||||||
# ----------------------------------------------------------
|
# ----------------------------------------------------------
|
||||||
- name: Read timedatectl status
|
- name: Read timedatectl status
|
||||||
ansible.builtin.command: timedatectl status
|
ansible.builtin.command: timedatectl
|
||||||
register: timedate_output
|
register: timedate_output
|
||||||
|
|
||||||
- name: Print server time + NTP source
|
- name: Print time + time source for each server
|
||||||
ansible.builtin.debug:
|
ansible.builtin.debug:
|
||||||
msg: |
|
msg: |
|
||||||
=== {{ inventory_hostname }} ===
|
=== {{ inventory_hostname }} ===
|
||||||
Current Time: {{ timedate_output.stdout | regex_search('Local time:\\s*(.*)', '\\1') }}
|
{{ timedate_output.stdout }}
|
||||||
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') }}
|
|
||||||
|
|
||||||
# ----------------------------------------------------------
|
# ----------------------------------------------------------
|
||||||
# FINAL SUMMARY
|
# FINAL SUMMARY
|
||||||
# ----------------------------------------------------------
|
# ----------------------------------------------------------
|
||||||
|
|||||||
Reference in New Issue
Block a user