feat: Add compatibility with CoreOS
This commit is contained in:
parent
ef7ce58296
commit
02056f9e6f
@ -1,13 +1,20 @@
|
|||||||
---
|
---
|
||||||
# handlers file for dnsmasq
|
# handlers file for dnsmasq
|
||||||
|
|
||||||
- name: Recharger dnsmasq.service
|
- name: Apply installation
|
||||||
|
ansible.builtin.command:
|
||||||
|
argv:
|
||||||
|
- /usr/bin/rpm-ostree
|
||||||
|
- apply-live
|
||||||
|
become: true
|
||||||
|
|
||||||
|
- name: Reload dnsmasq.service
|
||||||
become: true
|
become: true
|
||||||
ansible.builtin.systemd:
|
ansible.builtin.systemd:
|
||||||
state: reloaded
|
state: reloaded
|
||||||
name: dnsmasq.service
|
name: dnsmasq.service
|
||||||
|
|
||||||
- name: Recharger dnsmasq.service sur les serveurs
|
- name: Reload dnsmasq.service on dns servers
|
||||||
become: true
|
become: true
|
||||||
ansible.builtin.systemd:
|
ansible.builtin.systemd:
|
||||||
state: reloaded
|
state: reloaded
|
||||||
|
@ -11,5 +11,8 @@ galaxy_info:
|
|||||||
- name: Debian
|
- name: Debian
|
||||||
versions:
|
versions:
|
||||||
- all
|
- all
|
||||||
|
- name: CoreOS
|
||||||
|
versions:
|
||||||
|
- 41
|
||||||
|
|
||||||
dependencies: []
|
dependencies: []
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
---
|
---
|
||||||
# tasks file for security
|
# tasks file for security
|
||||||
|
|
||||||
- name: Déploiement des enregistrement via ansible
|
- name: Deploy records
|
||||||
ansible.builtin.template:
|
ansible.builtin.template:
|
||||||
owner: dnsmasq
|
owner: dnsmasq
|
||||||
group: root
|
group: root
|
||||||
@ -14,4 +14,4 @@
|
|||||||
loop: "{{ dnsmasq_hosts }}"
|
loop: "{{ dnsmasq_hosts }}"
|
||||||
loop_control:
|
loop_control:
|
||||||
loop_var: dnsserver
|
loop_var: dnsserver
|
||||||
notify: Recharger dnsmasq.service sur les serveurs
|
notify: Reload dnsmasq.service on dns servers
|
||||||
|
@ -1,13 +1,22 @@
|
|||||||
---
|
---
|
||||||
# tasks file for security
|
# tasks file for security
|
||||||
|
|
||||||
- name: Supprimer l'ancien fichier de configuration
|
- name: Create records directory
|
||||||
|
ansible.builtin.file:
|
||||||
|
path: /srv/dnsmasq
|
||||||
|
state: directory
|
||||||
|
owner: dnsmasq
|
||||||
|
group: root
|
||||||
|
mode: u=rwX,g=rX,o=rX
|
||||||
|
become: true
|
||||||
|
|
||||||
|
- name: Remove old configuration
|
||||||
ansible.builtin.file:
|
ansible.builtin.file:
|
||||||
path: /etc/dnsmasq.d/cache.conf
|
path: /etc/dnsmasq.d/cache.conf
|
||||||
state: absent
|
state: absent
|
||||||
become: true
|
become: true
|
||||||
|
|
||||||
- name: Configurer dnsmasq
|
- name: Deploy configuration
|
||||||
ansible.builtin.template:
|
ansible.builtin.template:
|
||||||
src: dnsmasq.conf.j2
|
src: dnsmasq.conf.j2
|
||||||
dest: /etc/dnsmasq.d/dns.conf
|
dest: /etc/dnsmasq.d/dns.conf
|
||||||
@ -15,9 +24,9 @@
|
|||||||
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: Reload dnsmasq.service
|
||||||
|
|
||||||
- name: Déployer la configuration de l'instance
|
- name: Deploy local host configuration
|
||||||
ansible.builtin.template:
|
ansible.builtin.template:
|
||||||
src: host.conf.j2
|
src: host.conf.j2
|
||||||
dest: /srv/dnsmasq/{{ inventory_hostname }}.conf
|
dest: /srv/dnsmasq/{{ inventory_hostname }}.conf
|
||||||
@ -25,9 +34,9 @@
|
|||||||
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: Reload dnsmasq.service
|
||||||
|
|
||||||
- name: Déployer les configurations specifiques
|
- name: Deploy specific configuration
|
||||||
ansible.builtin.template:
|
ansible.builtin.template:
|
||||||
src: specific.conf.j2
|
src: specific.conf.j2
|
||||||
dest: "{{ filename }}"
|
dest: "{{ filename }}"
|
||||||
@ -36,7 +45,7 @@
|
|||||||
mode: u=rw,g=r,o=r
|
mode: u=rw,g=r,o=r
|
||||||
when: dnsmasq_specifics | length > 0
|
when: dnsmasq_specifics | length > 0
|
||||||
become: true
|
become: true
|
||||||
notify: Recharger dnsmasq.service
|
notify: Reload dnsmasq.service
|
||||||
loop: "{{ dnsmasq_specifics }}"
|
loop: "{{ dnsmasq_specifics }}"
|
||||||
loop_control:
|
loop_control:
|
||||||
label: "{{ filename }}"
|
label: "{{ filename }}"
|
||||||
|
18
tasks/installation-atomic_container.yml
Normal file
18
tasks/installation-atomic_container.yml
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
---
|
||||||
|
# tasks file for dnsmasq
|
||||||
|
|
||||||
|
- name: Install stubby
|
||||||
|
ansible.builtin.command:
|
||||||
|
argv:
|
||||||
|
- /usr/bin/rpm-ostree
|
||||||
|
- install
|
||||||
|
- --allow-inactive
|
||||||
|
- --assumeyes
|
||||||
|
- --idempotent
|
||||||
|
- dnsmasq
|
||||||
|
creates: /sysroot/ostree/repo/refs/heads/rpmostree/pkg/dnsmasq
|
||||||
|
become: true
|
||||||
|
notify: Apply installation
|
||||||
|
|
||||||
|
- name: Flush handlers
|
||||||
|
meta: flush_handlers
|
@ -1,10 +1,10 @@
|
|||||||
---
|
---
|
||||||
# tasks file for dnsmasq
|
# tasks file for dnsmasq
|
||||||
|
|
||||||
- name: Importer les tâches d'installation
|
- name: Include installation tasks
|
||||||
tags: installation
|
ansible.builtin.include_tasks:
|
||||||
ansible.builtin.import_tasks: installation.yml
|
file: installation-{{ ansible_facts['pkg_mgr'] }}.yml
|
||||||
|
|
||||||
- name: Importer les tâches de configuration
|
- name: Import configuration tasks
|
||||||
tags: configuration
|
ansible.builtin.import_tasks:
|
||||||
ansible.builtin.import_tasks: configuration.yml
|
file: configuration.yml
|
||||||
|
Loading…
x
Reference in New Issue
Block a user