feat: Create role

This commit is contained in:
2022-10-03 17:20:34 +02:00
committed by pulsar89.5
parent f8ba73f84d
commit 9134f68038
12 changed files with 276 additions and 6 deletions

32
handlers/main.yml Normal file
View File

@@ -0,0 +1,32 @@
---
# handlers file for dnsmasq
- name: Apply installation
ansible.builtin.command:
argv:
- /usr/bin/rpm-ostree
- apply-live
become: true
- name: Restart systemd-resolved.service
ansible.builtin.systemd_service:
name: systemd-resolved.service
state: restarted
become: true
- name: Restart dnsmasq.service
ansible.builtin.systemd_service:
name: dnsmasq.service
state: restarted
become: true
register: dnsmasq_restarted
- name: Restart dnsmasq.service on dns servers
ansible.builtin.systemd_service:
name: dnsmasq.service
state: restarted
when: dnsmasq_restarted is undefined
become: true
loop: "{{ dnsmasq_hosts }}"
delegate_to: "{{ item }}"
run_once: true