dnsmasq with multi master arch

This commit is contained in:
Smaine Kahlouch
2015-12-11 11:48:43 +01:00
parent 3981b73924
commit b23b8aa3de
2 changed files with 11 additions and 4 deletions

View File

@@ -1,5 +1,9 @@
; generated by ansible
search {{ [ 'default.svc.' + dns_domain, 'svc.' + dns_domain, dns_domain ] | join(' ') }}
{% if inventory_hostname in groups['kube-master'] %}
nameserver {{ ansible_default_ipv4.address }}
{% else %}
{% for host in groups['kube-master'] %}
nameserver {{ hostvars[host]['ansible_default_ipv4']['address'] }}
{% endfor %}
{% endif %}