Kapisi/roles/ShadowArch/tasks/dns.yml

30 lines
748 B
YAML
Raw Normal View History

2022-01-25 23:54:43 -06:00
---
- name: Install DNS packages
become: yes
ignore_errors: yes
package:
name:
2022-01-25 23:54:43 -06:00
- bind
- net-tools
- iputils
state: present
- name: Set up /etc/resolv.conf
become: yes
copy:
dest: /etc/resolv.conf
content: "domain {{ replica_domain }}\nnameserver {{ dns }}\n"
owner: root
group: root
mode: 0644
- name: Set up /etc/hosts
vars:
ansible_become_password: "{{ passwords[inventory_hostname] }}"
become: yes
lineinfile:
dest: /etc/hosts
regexp: '^127.0.0.1[ \t]+localhost'
line: "127.0.0.1 localhost localhost.localdomain {{ inventory_hostname }} {{ inventory_hostname }}.{{ replica_domain }}"
state: present