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