ansible-edda/playbooks/roles/services/setup/system/tasks/include/nameserver.yml

15 lines
491 B
YAML

---
- name: "nameserver : fetch {{ services_resolv_host }}'s resolv.conf"
ansible.builtin.fetch:
src: "/etc/resolv.conf"
dest: "./files/services/setup/system/nameserver/"
flat: true
when:
ansible_hostname == services_resolv_host
- name: "nameserver : copy {{ services_resolv_host }}'s resolv.conf to other hosts"
ansible.builtin.copy:
src: "files/services/setup/system/nameserver/resolv.conf"
dest: "{{ system_etc_root_directory }}/resolv.conf"
mode: 0644