You've already forked role_dnsmasq
feat: Generate file for all ansible hosts
This commit is contained in:
13
templates/ansible_hosts.conf.j2
Normal file
13
templates/ansible_hosts.conf.j2
Normal file
@@ -0,0 +1,13 @@
|
||||
# {{ ansible_managed }}
|
||||
|
||||
{% for host in groups['all'] %}
|
||||
# BEGIN {{ host }}
|
||||
{% if hostvars[host]["dnsmasq_host_ipv4"] | length > 0 %}
|
||||
hostvars[host]["dnsmasq_host_ipv4"] {{ hostvars[host]["dnsmasq_client_hostname"] }} {{ hostvars[host]["dnsmasq_host_aliases"] | join(' ') }}
|
||||
{% endif %}
|
||||
{% if hostvars[host]["dnsmasq_host_ipv4"] | length > 0 %}
|
||||
hostvars[host]["dnsmasq_host_ipv4"] {{ hostvars[host]["dnsmasq_client_hostname"] }} {{ hostvars[host]["dnsmasq_host_aliases"] | join(' ') }}
|
||||
{% endif %}
|
||||
# END {{ host }}
|
||||
|
||||
{% endfor %}
|
@@ -37,4 +37,4 @@ rebind-localhost-ok
|
||||
cache-size=1024
|
||||
|
||||
# Définir le fichier des entrées personnalisées
|
||||
addn-hosts=/srv/dnsmasq
|
||||
addn-hosts=/srv/dnsmasq/*.conf
|
||||
|
Reference in New Issue
Block a user