---
- name: Service Status Check and Conditional Disable
hosts: all
gather_facts: yes
become: yes
serial: 5
vars:
disable_auditd: false
disable_mlocate: false
disable_ntp_services: false
max_time_drift_seconds: 30
ntp_server_pool: "pool.ntp.org"
backup_configs: true
log_changes: true
tasks:
- name: Include service status check
include_tasks: service_status_check_complete.yml
- name: Include conditional service disable tasks
include_tasks: conditional_service_disable.yml
- name: Include time synchronization tasks
include_tasks: time_sync_correction.yml
when: node_result.ntp.ntp_synchronized == false or
(time_reference is defined and
((node_result.current_time | to_datetime('%Y-%m-%dT%H:%M:%SZ')) -
(time_reference | to_datetime('%Y-%m-%dT%H:%M:%SZ'))).total_seconds() | abs > max_time_drift_seconds)
- name: Include final verification
include_tasks: final_verification.yml