add capability to disable systemd-resolved to base_config role
This commit is contained in:
parent
d9fc1ef401
commit
58ced1a85e
9 changed files with 131 additions and 0 deletions
25
roles/deploy_systemd_resolved_config/tasks/disable.yaml
Normal file
25
roles/deploy_systemd_resolved_config/tasks/disable.yaml
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
---
|
||||
- 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
|
||||
Loading…
Add table
Add a link
Reference in a new issue