From ed928c20c777c25c904fd039375ac4caed3b6072 Mon Sep 17 00:00:00 2001 From: Sven Velt Date: Thu, 3 Dec 2020 14:47:57 +0100 Subject: [PATCH] Network var file allowed but not necessary --- roles/timesync-enabled/tasks/main.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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"