mirror of
https://github.com/iiab/iiab.git
synced 2025-03-09 15:40:17 +00:00
use iiab-dnsmasq.service everywhere
This commit is contained in:
parent
f4a99abaf2
commit
00152a0769
3 changed files with 23 additions and 48 deletions
|
@ -3,30 +3,18 @@
|
||||||
name: dnsmasq
|
name: dnsmasq
|
||||||
state: present
|
state: present
|
||||||
|
|
||||||
- name: Install /etc/dnsmasq.d/dnsmasq-iiab, allowing systemd-resolved AND dnsmasq to work (#1306)
|
- name: Install /etc/dnsmasq.d/dnsmasq-iiab, allowing systemd-resolved AND dnsmasq to work (#1306) and custom unit file
|
||||||
template:
|
template:
|
||||||
src: roles/network/templates/network/dnsmasq-iiab
|
src: "{{ item.src }}"
|
||||||
dest: /etc/dnsmasq.d/dnsmasq-iiab
|
dest: "{{ item.dest }}"
|
||||||
|
owner: root
|
||||||
|
group: root
|
||||||
|
mode: "{{ item.mode }}"
|
||||||
|
with_items:
|
||||||
|
- { src: 'roles/network/templates/network/dnsmasq.service.u18', dest: '/etc/systemd/system/iiab-dnsmasq.service', mode: '0644' }
|
||||||
|
- { src: 'roles/network/templates/network/dnsmasq-iiab', dest: '/etc/dnsmasq.d/dnsmasq-iiab', mode: '644' }
|
||||||
|
|
||||||
#- name: Stop dnsmasq
|
- name: Don't use stock dnsmasq systemd unit file during boot
|
||||||
# service:
|
systemd:
|
||||||
# name: dnsmasq
|
name: dnsmasq
|
||||||
# state: stopped
|
enabled: no
|
||||||
|
|
||||||
#- name: Configure dnsmasq
|
|
||||||
# template:
|
|
||||||
# src: "{{ item.src }}"
|
|
||||||
# dest: "{{ item.dest }}"
|
|
||||||
# owner: root
|
|
||||||
# group: root
|
|
||||||
# mode: "{{ item.mode }}"
|
|
||||||
# with_items:
|
|
||||||
## - { src: 'network/dnsmasq.service.rh', dest: '/etc/systemd/system/dnsmasq.service', mode: '0644' }
|
|
||||||
# - { src: 'roles/network/templates/network/dnsmasq.conf.j2', dest: '/etc/dnsmasq.conf', mode: '644' }
|
|
||||||
|
|
||||||
#- name: Start dnsmasq
|
|
||||||
# systemd:
|
|
||||||
# name: dnsmasq
|
|
||||||
# state: restarted
|
|
||||||
# enabled: yes
|
|
||||||
# daemon_reload: yes
|
|
||||||
|
|
|
@ -47,24 +47,24 @@
|
||||||
enabled: no
|
enabled: no
|
||||||
when: not named_enabled and named_install
|
when: not named_enabled and named_install
|
||||||
|
|
||||||
- name: Disable dnsmasq, if not dnsmasq_enabled
|
|
||||||
systemd:
|
|
||||||
name: dnsmasq
|
|
||||||
enabled: no
|
|
||||||
when: not dnsmasq_enabled and dnsmasq_install
|
|
||||||
|
|
||||||
- name: Install /etc/dnsmasq.conf from template, if dnsmasq_enabled
|
- name: Install /etc/dnsmasq.conf from template, if dnsmasq_enabled
|
||||||
template:
|
template:
|
||||||
src: network/dnsmasq.conf.j2
|
src: network/dnsmasq.conf.j2
|
||||||
dest: /etc/dnsmasq.conf
|
dest: /etc/dnsmasq.conf
|
||||||
when: dnsmasq_enabled and dnsmasq_install
|
when: dnsmasq_enabled and dnsmasq_install
|
||||||
|
|
||||||
- name: Enable dnsmasq systemd service, if dnsmasq_enabled
|
- name: Enable iiab-dnsmasq systemd service, if dnsmasq_enabled
|
||||||
systemd:
|
systemd:
|
||||||
name: dnsmasq
|
name: iiab-dnsmasq
|
||||||
enabled: yes
|
enabled: yes
|
||||||
when: dnsmasq_enabled and dnsmasq_install
|
when: dnsmasq_enabled and dnsmasq_install
|
||||||
|
|
||||||
|
- name: Disable iiab-dnsmasq, if not dnsmasq_enabled
|
||||||
|
systemd:
|
||||||
|
name: iiab-dnsmasq
|
||||||
|
enabled: no
|
||||||
|
when: not dnsmasq_enabled and dnsmasq_install
|
||||||
|
|
||||||
- name: Enable DansGuardian systemd service, if dansguardian_enabled
|
- name: Enable DansGuardian systemd service, if dansguardian_enabled
|
||||||
systemd:
|
systemd:
|
||||||
name: dansguardian
|
name: dansguardian
|
||||||
|
|
|
@ -17,25 +17,11 @@
|
||||||
- "{{ netplan.stdout }}"
|
- "{{ netplan.stdout }}"
|
||||||
when: netplan.stdout.find("yml") != -1
|
when: netplan.stdout.find("yml") != -1
|
||||||
|
|
||||||
### NM might need attention also
|
- name: Ensure systemd-networkd-wait-online is enabled
|
||||||
- name: Disable the stock dnsmasq unit file that starts too early with systemd_networkd_active
|
|
||||||
systemd:
|
|
||||||
name: dnsmasq
|
|
||||||
enabled: no
|
|
||||||
# when: systemd_networkd_active
|
|
||||||
|
|
||||||
- name: Install dnsmasq helper unit file when systemd_networkd_active
|
|
||||||
template:
|
|
||||||
src: network/dnsmasq.service.u18
|
|
||||||
dest: /etc/systemd/system/iiab-dnsmasq.service
|
|
||||||
# when: systemd_networkd_active
|
|
||||||
|
|
||||||
- name: Ensure required dnsmasq unit files are enabled for reboot systemd_networkd_active
|
|
||||||
systemd:
|
systemd:
|
||||||
name: "{{ item }}"
|
name: "{{ item }}"
|
||||||
enabled: yes
|
enabled: yes
|
||||||
with_items:
|
with_items:
|
||||||
- iiab-dnsmasq
|
|
||||||
- systemd-networkd-wait-online
|
- systemd-networkd-wait-online
|
||||||
when: systemd_networkd_active
|
when: systemd_networkd_active
|
||||||
|
|
||||||
|
@ -59,6 +45,7 @@
|
||||||
src: network/netplan.j2
|
src: network/netplan.j2
|
||||||
backup: no
|
backup: no
|
||||||
|
|
||||||
|
# should blow up here if we messed up the yml file
|
||||||
#- name: Generate netplan config
|
#- name: Generate netplan config
|
||||||
# shell: netplan generate --debug
|
# shell: netplan generate --debug
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue