diff --git a/roles/systemd_resolved/meta/argument_specs.yml b/roles/systemd_resolved/meta/argument_specs.yml index fef3b0b..73fff42 100644 --- a/roles/systemd_resolved/meta/argument_specs.yml +++ b/roles/systemd_resolved/meta/argument_specs.yml @@ -47,6 +47,8 @@ argument_specs: systemd_resolved_dnsstublistener: type: str choices: + - false + - true - tcp - udp systemd_resolved_readetchosts: diff --git a/roles/systemd_resolved/tasks/resolv.conf.yml b/roles/systemd_resolved/tasks/resolv.conf.yml index a8133b6..7090d47 100644 --- a/roles/systemd_resolved/tasks/resolv.conf.yml +++ b/roles/systemd_resolved/tasks/resolv.conf.yml @@ -1,8 +1,18 @@ --- - name: Ensure resolv.conf + ansible.builtin.file: + src: /run/systemd/resolve/resolv.conf + dest: /etc/resolv.conf + state: link + force: true + become: true + when: not systemd_resolved_dnsstublistener + +- name: Ensure stub resolv.conf ansible.builtin.file: src: /run/systemd/resolve/stub-resolv.conf dest: /etc/resolv.conf state: link force: true become: true + when: systemd_resolved_dnsstublistener