diff --git a/roles/timesync-enabled/tasks/main.yml b/roles/timesync-enabled/tasks/main.yml index 9c24dec..c09b4a1 100644 --- a/roles/timesync-enabled/tasks/main.yml +++ b/roles/timesync-enabled/tasks/main.yml @@ -6,8 +6,10 @@ - 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|default(False) == False and timesync_pools|default(False) == False) + 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) - name: "Set NTP »pools« for machines without default gateway"