From 1090043f34a07444b0d02023d670e47e49e93e9c Mon Sep 17 00:00:00 2001 From: "pulsar89.5" Date: Wed, 13 Dec 2023 17:24:08 +0100 Subject: [PATCH] Revert "feat: Generate file for all ansible hosts" This reverts commit 3b2c621dcab13555fa1ea6c58347fa6e2cdb9346. --- tasks/configuration.yml | 16 +++------------- templates/ansible_hosts.conf.j2 | 13 ------------- templates/dnsmasq.conf.j2 | 2 +- 3 files changed, 4 insertions(+), 27 deletions(-) delete mode 100644 templates/ansible_hosts.conf.j2 diff --git a/tasks/configuration.yml b/tasks/configuration.yml index 5ccc635..3f55b91 100644 --- a/tasks/configuration.yml +++ b/tasks/configuration.yml @@ -11,26 +11,16 @@ become: true notify: Recharger dnsmasq.service -- name: Déployer la configuration des hôtes ansible +- name: Déployer la configuration de l'instance ansible.builtin.template: - src: ansible_hosts.conf.j2 - dest: /srv/dnsmasq/ansible_hosts.disabled + 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 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 ansible.builtin.template: src: specific.conf.j2 diff --git a/templates/ansible_hosts.conf.j2 b/templates/ansible_hosts.conf.j2 deleted file mode 100644 index 73ec6b7..0000000 --- a/templates/ansible_hosts.conf.j2 +++ /dev/null @@ -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 %} diff --git a/templates/dnsmasq.conf.j2 b/templates/dnsmasq.conf.j2 index 373675b..66c785d 100644 --- a/templates/dnsmasq.conf.j2 +++ b/templates/dnsmasq.conf.j2 @@ -37,4 +37,4 @@ rebind-localhost-ok cache-size=1024 # Définir le fichier des entrées personnalisées -addn-hosts=/srv/dnsmasq/*.conf +addn-hosts=/srv/dnsmasq