Only disable stub resolver for control machines

This commit is contained in:
Sam A. 2023-11-07 22:25:43 +01:00
parent 65be11b3f1
commit 0b539463e9
Signed by: samsapti
GPG key ID: CBBBE7371E81C4EA

View file

@ -16,21 +16,24 @@
owner: root owner: root
mode: u=rw,g=r,o=r mode: u=rw,g=r,o=r
- name: Set /etc/resolv.conf symlink
ansible.builtin.file:
path: /etc/resolv.conf
src: /run/systemd/resolve/resolv.conf
owner: root
force: true
state: link
- name: Disable systemd-resolved stub resolver - name: Disable systemd-resolved stub resolver
ansible.builtin.lineinfile: when: hostname in groups['control_infra']
path: /etc/systemd/resolved.conf block:
regexp: '^#?DNSStubListener=' - name: Set /etc/resolv.conf symlink
line: 'DNSStubListener=no' ansible.builtin.file:
state: present path: /etc/resolv.conf
notify: Restart systemd-resolved src: /run/systemd/resolve/resolv.conf
owner: root
force: true
state: link
- name: Comment out DNSStubListener
ansible.builtin.lineinfile:
path: /etc/systemd/resolved.conf
regexp: '^#?DNSStubListener='
line: 'DNSStubListener=no'
state: present
notify: Restart systemd-resolved
- name: Install packages via apt - name: Install packages via apt
ansible.builtin.apt: ansible.builtin.apt: