role_dnsmasq/tasks/configuration.yml

45 lines
1.1 KiB
YAML
Raw Permalink Normal View History

2022-10-03 15:20:34 +00:00
---
# tasks file for security
2024-05-06 18:40:10 +00:00
- name: Supprimer l'ancien fichier de configuration
ansible.builtin.file:
path: /etc/dnsmasq.d/cache.conf
state: absent
become: true
2022-10-03 15:20:34 +00:00
- name: Configurer dnsmasq
ansible.builtin.template:
src: dnsmasq.conf.j2
2024-05-06 18:40:10 +00:00
dest: /etc/dnsmasq.d/dns.conf
2022-10-03 15:20:34 +00:00
owner: root
group: root
mode: u=rw,g=r,o=r
become: true
notify: Recharger dnsmasq.service
- name: Déployer la configuration de l'instance
2022-10-03 15:20:34 +00:00
ansible.builtin.template:
src: host.conf.j2
dest: /srv/dnsmasq/{{ inventory_hostname }}.conf
2022-10-03 15:20:34 +00:00
owner: dnsmasq
group: root
mode: u=rw,g=r,o=r
become: true
notify: Recharger dnsmasq.service
2023-09-26 09:12:29 +00:00
- name: Déployer les configurations specifiques
ansible.builtin.template:
src: specific.conf.j2
dest: "{{ filename }}"
owner: dnsmasq
group: root
mode: u=rw,g=r,o=r
when: dnsmasq_specifics | length > 0
become: true
notify: Recharger dnsmasq.service
loop: "{{ dnsmasq_specifics }}"
loop_control:
label: "{{ filename }}"
vars:
filename: /srv/dnsmasq/{{ item.hostname }}.conf