ansible-infra/roles/deploy_systemd_resolved_config/tasks/disable.yaml
lilly 58ced1a85e
All checks were successful
/ Ansible Lint (push) Successful in 2m28s
/ Ansible Lint (pull_request) Successful in 2m24s
add capability to disable systemd-resolved to base_config role
2026-05-01 00:16:43 +02:00

25 lines
639 B
YAML

---
- name: Ensure /etc/resolv.conf is a plain file
tags: [ "deploy_systemd_resolved_config" ]
become: true
ansible.builtin.file:
path: "/etc/resolv.conf"
state: file
- name: Write nameserver config directly into /etc/resolv.conf
tags: [ "deploy_systemd_resolved_config" ]
become: true
ansible.builtin.template:
src: "resolv.conf.j2"
dest: "/etc/resolv.conf"
owner: root
group: root
mode: u=rw,g=r,o=r
- name: Disable systemd-resolved
tags: [ "deploy_systemd_resolved_config" ]
become: true
ansible.builtin.systemd:
name: "systemd-resolved.service"
state: stopped
enabled: false