machine_setup/ansible/roles/public_dns/tasks/freebsd.yaml
Tom Alexander 1c42f01db2
Switch public_dns to PowerDNS for RFC-2136 support.
This is needed for cert-manager. It will also be used for the external dns operator but the external dns operator also had a programmatic way to support CoreDNS through etcd.
2023-06-20 00:25:15 -04:00

56 lines
1.1 KiB
YAML

- name: Install packages
package:
name:
- powerdns
state: present
- name: Install service configuration
copy:
src: "files/{{ item }}_rc.conf"
dest: "/etc/rc.conf.d/{{ item }}"
mode: 0644
owner: root
group: wheel
loop:
- pdns
- name: Create directories
file:
name: "{{ item }}"
state: directory
mode: 0755
owner: pdns
group: pdns
loop:
- /var/lib/powerdns
- /var/lib/powerdns/zones/
- name: Copy files
copy:
src: "files/{{ item.src }}"
dest: "{{ item.dest }}"
mode: 0644
owner: root
group: wheel
loop:
- src: pdns.conf
dest: /usr/local/etc/pdns/
- src: bind.conf
dest: /usr/local/etc/pdns/
- name: Initialize DB
command: "sudo -u pdns sqlite3 -init /usr/local/share/doc/powerdns/schema.sqlite3.sql /var/lib/powerdns/pdns.sqlite3"
args:
creates: "/var/lib/powerdns/pdns.sqlite3"
- name: Copy files
copy:
src: "files/{{ item.src }}"
dest: "{{ item.dest }}"
mode: 0644
owner: pdns
group: pdns
loop:
- src: master.db
dest: /var/lib/powerdns/zones/