dns_resolver_conf/tasks/systemd.yml
Bertrand Lanson 6218ed1fdd
All checks were successful
test / Linting (push) Successful in 28s
test / Molecule tests (default, ubuntu2004) (push) Successful in 47s
test / Molecule tests (default, debian12) (push) Successful in 1m15s
test / Molecule tests (default, debian11) (push) Successful in 1m24s
test / Molecule tests (default, ubuntu2204) (push) Successful in 52s
test / Molecule tests (with_custom_config, debian11) (push) Successful in 56s
test / Molecule tests (with_custom_config, ubuntu2004) (push) Successful in 31s
test / Molecule tests (with_custom_config, debian12) (push) Successful in 1m0s
test / Molecule tests (with_custom_config, ubuntu2204) (push) Successful in 46s
feat: add become: true, add vagrant tests, add systemd-resolved service check to avoid failure if service is not on host
2023-12-01 18:36:27 +01:00

13 lines
451 B
YAML

---
# task/systemd file for dns_resolver_conf
- name: "Populate service facts"
ansible.builtin.service_facts:
- name: "Configure systemd-resolved"
ansible.builtin.service:
name: systemd-resolved
enabled: "{{ 'true' if not dns_resolv_conf_disable_resolvectl else 'false' }}"
state: "{{ 'started' if not dns_resolv_conf_disable_resolvectl else 'stopped' }}"
when: "'systemd-resolved.service' in ansible_facts.services"
become: true