roles_timesync/roles/timesync-enabled/tasks/main.yml

29 lines
785 B
YAML
Raw Normal View History

2017-11-30 14:28:28 +00:00
---
- name: Check selected timesync daemon
fail:
fail_msg: "{{ timesync_daemon|default('No daemon') }} not supported"
when: timesync_daemon not in [ "ntp", "timesyncd" ]
2017-11-30 14:28:28 +00:00
- name: Include each network variables if there is no host variable
include_vars: "vars/timesync_{{ ansible_default_ipv4.network }}.yml"
when: ansible_default_ipv4 and timesync_servers is not defined
- name: Set NTP server for machines without default gateway
set_fact:
timesync_servers: "{{ timesync_default_servers }}"
when: timesync_servers is not defined
- name: Include OS dependent variables
include_vars: "{{ item }}"
with_first_found:
- "os_{{ (ansible_os_family|lower).split(' ')[0] }}.yml"
- "os_defaut.yml"
2017-11-30 14:28:28 +00:00
- include_tasks: "timesync_{{ timesync_daemon }}.yml"
2017-11-30 14:28:28 +00:00