fix(ansible): audit time sync across systemd-timesyncd and chrony without dbus dependency

This commit is contained in:
2026-11-02 14:05:08 -05:00
parent 003ae80c9c
commit 08d085b95f
11 changed files with 13 additions and 2 deletions

View File

@@ -4,10 +4,10 @@
gather_facts: false
tasks:
- name: Audit system time sync status
ansible.builtin.command: timedatectl show -p NTPSynchronized --value
ansible.builtin.shell: systemctl is-active systemd-timesyncd || systemctl is-active chrony || systemctl is-active chronyd
register: time_sync
changed_when: false
failed_when: time_sync.stdout != "yes"
failed_when: time_sync.stdout != "active"
- name: Audit Zabbix Agent 2 service status
ansible.builtin.command: systemctl is-active zabbix-agent2
@@ -24,3 +24,4 @@
- name: Display host audit status
ansible.builtin.debug:
msg: "{{ inventory_hostname }} ({{ ansible_host }}) [OK]: TimeSync={{ time_sync.stdout }}, Zabbix={{ zabbix_status.stdout }}, SSHKey=Verified"