From c66f2b36afdcce358f4e6531cbe9c3ee7ed8f029 Mon Sep 17 00:00:00 2001 From: Alexandre Iooss Date: Sun, 26 Apr 2020 22:51:48 +0200 Subject: [PATCH] [bind] Cache and fix master detection --- roles/bind-authoritative/tasks/main.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/roles/bind-authoritative/tasks/main.yml b/roles/bind-authoritative/tasks/main.yml index 97e31127..b5bbb4a8 100644 --- a/roles/bind-authoritative/tasks/main.yml +++ b/roles/bind-authoritative/tasks/main.yml @@ -13,10 +13,12 @@ masters_ipv6: "{{ bind.masters | json_query('servers[].interface[?vlan_id==`2`].ipv6[][].ipv6') }}" slaves_ipv4: "{{ bind.slaves | json_query('servers[].interface[?vlan_id==`2`].ipv4[]') }}" slaves_ipv6: "{{ bind.slaves | json_query('servers[].interface[?vlan_id==`2`].ipv6[][].ipv6') }}" + cacheable: true - name: Is this the master? set_fact: - is_master: "{{ ansible_all_ipv4_addresses | intersect(masters_ipv4) | bool }}" + is_master: "{{ ansible_all_ipv4_addresses | intersect(masters_ipv4) | length > 0 }}" + cacheable: true - name: Deploy Bind9 configuration template: