inventoryFromAnsible #4
@ -11,26 +11,16 @@
|
|||||||
become: true
|
become: true
|
||||||
notify: Recharger dnsmasq.service
|
notify: Recharger dnsmasq.service
|
||||||
|
|
||||||
- name: Déployer la configuration des hôtes ansible
|
- name: Déployer la configuration de l'instance
|
||||||
ansible.builtin.template:
|
ansible.builtin.template:
|
||||||
src: ansible_hosts.conf.j2
|
src: host.conf.j2
|
||||||
dest: /srv/dnsmasq/ansible_hosts.disabled
|
dest: /srv/dnsmasq/{{ inventory_hostname }}.conf
|
||||||
owner: dnsmasq
|
owner: dnsmasq
|
||||||
group: root
|
group: root
|
||||||
mode: u=rw,g=r,o=r
|
mode: u=rw,g=r,o=r
|
||||||
become: true
|
become: true
|
||||||
notify: Recharger dnsmasq.service
|
notify: Recharger dnsmasq.service
|
||||||
|
|
||||||
#- name: Déployer la configuration de l'instance
|
|
||||||
# ansible.builtin.template:
|
|
||||||
# src: host.conf.j2
|
|
||||||
# dest: /srv/dnsmasq/{{ inventory_hostname }}.conf
|
|
||||||
# owner: dnsmasq
|
|
||||||
# group: root
|
|
||||||
# mode: u=rw,g=r,o=r
|
|
||||||
# become: true
|
|
||||||
# notify: Recharger dnsmasq.service
|
|
||||||
|
|
||||||
- name: Déployer les configurations specifiques
|
- name: Déployer les configurations specifiques
|
||||||
ansible.builtin.template:
|
ansible.builtin.template:
|
||||||
src: specific.conf.j2
|
src: specific.conf.j2
|
||||||
|
@ -1,13 +0,0 @@
|
|||||||
# {{ 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
|
cache-size=1024
|
||||||
|
|
||||||
# Définir le fichier des entrées personnalisées
|
# Définir le fichier des entrées personnalisées
|
||||||
addn-hosts=/srv/dnsmasq/*.conf
|
addn-hosts=/srv/dnsmasq
|
||||||
|
Loading…
Reference in New Issue
Block a user