2023-03-20 21:48:29 +00:00
|
|
|
---
|
|
|
|
# task/systemd file for dns_resolver_conf
|
2023-12-01 17:36:27 +00:00
|
|
|
- name: "Populate service facts"
|
|
|
|
ansible.builtin.service_facts:
|
|
|
|
|
2023-03-20 21:48:29 +00:00
|
|
|
- name: "Configure systemd-resolved"
|
2023-03-20 22:37:11 +00:00
|
|
|
ansible.builtin.service:
|
2023-03-20 21:48:29 +00:00
|
|
|
name: systemd-resolved
|
|
|
|
enabled: "{{ 'true' if not dns_resolv_conf_disable_resolvectl else 'false' }}"
|
2023-03-20 22:37:11 +00:00
|
|
|
state: "{{ 'started' if not dns_resolv_conf_disable_resolvectl else 'stopped' }}"
|
2023-12-01 17:36:27 +00:00
|
|
|
when: "'systemd-resolved.service' in ansible_facts.services"
|
|
|
|
become: true
|