homeserver-iac/roles/networking/nameserver/tasks/main.yml
dogeystamp aba27dfafc
nameserver: split horizon dns for the vpn
should avoid vpn conflicts with local ip subnet
2024-12-15 17:11:02 -05:00

36 lines
761 B
YAML

# - name: Install nameserver packages
# community.general.pacman:
# name: bind
# state: present
#
- name: Configure nameserver
template:
src: named.conf.j2
dest: /etc/named.conf
validate: /usr/bin/named-checkconf %s
notify: Restart nameserver
- name: Add nameserver zone (LAN)
template:
src: local_zone.j2
dest: "/var/named/{{ dyndns_domain }}"
notify: Restart nameserver
vars:
resolve_ip: "{{ local_ip }}"
serial: "42"
- name: Add nameserver zone (VPN)
template:
src: local_zone.j2
dest: "/var/named/{{ dyndns_domain }}.vpn"
notify: Restart nameserver
vars:
resolve_ip: "{{ vpn_ip }}"
serial: "43"
- name: Enable nameserver
service:
name: named
enabled: yes
state: started