0
0
vps-set-up-playbook/roles/oracle-systemd-resolved/tasks/main.yaml
2024-10-29 19:50:47 +08:00

33 lines
775 B
YAML

- name: Install systemd-resolved
apt:
name:
- systemd-resolved
state: latest
install_recommends: false
when: inventory_hostname in groups["oracle"]
- name: Create resolved.conf.d directory
ansible.builtin.file:
path: /etc/systemd/resolved.conf.d
state: directory
owner: 0
group: 0
mode: '0755'
when: inventory_hostname in groups["oracle"]
- name: Set up /etc/systemd/resolved.conf.d/oracle.conf
copy:
src: "oracle.conf"
dest: "/etc/systemd/resolved.conf.d/oracle.conf"
owner: 0
group: 0
mode: "0644"
when: inventory_hostname in groups["oracle"]
- name: Restart systemd-resolved
service:
name: systemd-resolved
enabled: true
state: restarted
when: inventory_hostname in groups["oracle"]