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

15 lines
516 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: "{{ services_root_directory }}/{{ services_resolv_host }}-resolv.conf"
mode: 0644