Update playbooks/check-time-sync.yml

This commit is contained in:
2025-07-11 00:44:18 +00:00
parent 98e07f59dd
commit 33f573fca8

View File

@@ -19,7 +19,14 @@
changed_when: false changed_when: false
failed_when: ntp_offset.rc != 0 failed_when: ntp_offset.rc != 0
- name: Extract and display final offset line - name: Try to extract final offset line
set_fact:
ntp_offset_summary: "{{ ntp_offset.stdout_lines | select('search', 'adjust time') | list | first | default('No offset line found') }}"
- name: Show full ntpdate output per host
debug: debug:
msg: | msg: |
[{{ inventory_hostname }}] -> {{ ntp_offset.stdout_lines | select('search', 'adjust time') | list | first | default('No offset reported') }} [{{ inventory_hostname }}]
Offset summary: {{ ntp_offset_summary }}
Raw output:
{{ ntp_offset.stdout_lines | join('\n') }}