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
|
||||
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:
|
||||
src: roles/network/templates/network/dnsmasq-iiab
|
||||
dest: /etc/dnsmasq.d/dnsmasq-iiab
|
||||
src: "{{ item.src }}"
|
||||
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
|
||||
# service:
|
||||
# name: dnsmasq
|
||||
# state: stopped
|
||||
|
||||
#- 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
|
||||
- name: Don't use stock dnsmasq systemd unit file during boot
|
||||
systemd:
|
||||
name: dnsmasq
|
||||
enabled: no
|
||||
|
|
|
@ -47,24 +47,24 @@
|
|||
enabled: no
|
||||
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
|
||||
template:
|
||||
src: network/dnsmasq.conf.j2
|
||||
dest: /etc/dnsmasq.conf
|
||||
when: dnsmasq_enabled and dnsmasq_install
|
||||
|
||||
- name: Enable dnsmasq systemd service, if dnsmasq_enabled
|
||||
- name: Enable iiab-dnsmasq systemd service, if dnsmasq_enabled
|
||||
systemd:
|
||||
name: dnsmasq
|
||||
name: iiab-dnsmasq
|
||||
enabled: yes
|
||||
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
|
||||
systemd:
|
||||
name: dansguardian
|
||||
|
|
|
@ -17,25 +17,11 @@
|
|||
- "{{ netplan.stdout }}"
|
||||
when: netplan.stdout.find("yml") != -1
|
||||
|
||||
### NM might need attention also
|
||||
- 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
|
||||
- name: Ensure systemd-networkd-wait-online is enabled
|
||||
systemd:
|
||||
name: "{{ item }}"
|
||||
enabled: yes
|
||||
with_items:
|
||||
- iiab-dnsmasq
|
||||
- systemd-networkd-wait-online
|
||||
when: systemd_networkd_active
|
||||
|
||||
|
@ -59,6 +45,7 @@
|
|||
src: network/netplan.j2
|
||||
backup: no
|
||||
|
||||
# should blow up here if we messed up the yml file
|
||||
#- name: Generate netplan config
|
||||
# shell: netplan generate --debug
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue