fix(ansible): audit time sync across systemd-timesyncd and chrony without dbus dependency
This commit is contained in:
@@ -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"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user