machine_setup/ansible/roles/public_dns/tasks/freebsd.yaml

56 lines
1.1 KiB
YAML
Raw Normal View History

2023-06-18 19:21:16 +00:00
- name: Install packages
package:
name:
- powerdns
2023-06-18 19:21:16 +00:00
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
2023-06-18 19:21:16 +00:00
- name: Create directories
file:
name: "{{ item }}"
state: directory
mode: 0755
owner: pdns
group: pdns
2023-06-18 19:21:16 +00:00
loop:
- /var/lib/powerdns
- /var/lib/powerdns/zones/
2023-06-18 19:21:16 +00:00
- 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:
2023-06-18 19:21:16 +00:00
- src: master.db
dest: /var/lib/powerdns/zones/