2017-11-30 14:28:28 +00:00
---
2020-12-02 20:55:22 +00:00
- name : Check selected timesync daemon
fail :
fail_msg : "{{ timesync_daemon|default('No daemon') }} not supported"
2020-12-02 21:18:36 +00:00
when : timesync_daemon not in [ "busybox-ntp", "chrony", "ntp", "timesyncd" ]
2020-12-02 20:55:22 +00:00
2017-11-30 14:28:28 +00:00
- name : Include each network variables if there is no host variable
2020-12-03 13:47:57 +00:00
include_vars : "{{ timesync_varfile_network }}"
vars :
timesync_varfile_network : "vars/timesync_{{ ansible_default_ipv4.network }}.yml"
when : ansible_default_ipv4 and timesync_varfile_network is file and (timesync_servers|default(False) == False and timesync_pools|default(False) == False)
2017-11-30 14:28:28 +00:00
2020-12-02 21:07:40 +00:00
- name : "Set NTP »pools« for machines without default gateway"
set_fact :
timesync_pools : "{{ timesync_default_pools }}"
when : timesync_servers|default(False) == False and timesync_pools|default(False) == False
- name : "Set NTP »server« for machines without default gateway"
2017-11-30 14:28:28 +00:00
set_fact :
timesync_servers : "{{ timesync_default_servers }}"
2020-12-02 21:07:40 +00:00
when : timesync_servers|default(False) == False and timesync_pools|default(False) == False
2017-11-30 14:28:28 +00:00
2020-12-02 20:55:22 +00:00
- name : Include OS dependent variables
include_vars : "{{ item }}"
with_first_found :
2020-12-03 13:48:28 +00:00
- "os_{{ (ansible_os_family|default('Not-Available')|lower).split(' ')[0] }}.yml"
- "os_{{ (ansible_lsb.id|default('Not-Available')|lower).split(' ')[0] }}.yml"
2020-12-02 20:55:22 +00:00
- "os_defaut.yml"
2017-11-30 14:28:28 +00:00
2020-12-02 21:44:01 +00:00
- name : Disable VMware timesync
shell : 'vmware-toolbox-cmd timesync disable'
changed_when : False
when : ansible_virtualization_type|lower == "vmware"
2020-12-02 20:55:22 +00:00
- include_tasks : "timesync_{{ timesync_daemon }}.yml"
2017-11-30 14:28:28 +00:00