✨: nsd, the comeback
All checks were successful
ansible-lint / lint-everything (push) Successful in 2m4s
All checks were successful
ansible-lint / lint-everything (push) Successful in 2m4s
This commit is contained in:
30
roles/nsd/tasks/prerequisites.yml
Normal file
30
roles/nsd/tasks/prerequisites.yml
Normal file
@@ -0,0 +1,30 @@
|
||||
---
|
||||
|
||||
- name: Gather facts on listening ports
|
||||
community.general.listen_ports_facts:
|
||||
|
||||
- name: Detect systemd-resolve
|
||||
ansible.builtin.set_fact:
|
||||
_systemd_resolve_enable: "{{ ansible_facts.udp_listen | selectattr('port', 'eq', 53) | selectattr('name', 'eq', 'systemd-resolve') | count > 0 }}"
|
||||
|
||||
- name: Deactivate DNS stublistener
|
||||
ansible.builtin.lineinfile:
|
||||
path: /etc/systemd/resolved.conf
|
||||
regex: '^#DNSStubListener=yes'
|
||||
line: DNSStubListener=no
|
||||
when: _systemd_resolve_enable
|
||||
notify:
|
||||
- Restart systemd-resolved
|
||||
|
||||
- name: Force restart for stub resolver
|
||||
ansible.builtin.meta: flush_handlers
|
||||
|
||||
- name: Install nsd & utilities
|
||||
ansible.builtin.package:
|
||||
name:
|
||||
- nsd
|
||||
- dnsutils
|
||||
- ldnsutils
|
||||
- cron
|
||||
state: present
|
||||
update_cache: true
|
Reference in New Issue
Block a user