unbound: Add support for copying zone files
This commit is contained in:
parent
2329b5d5e6
commit
3b2c2a453e
11 changed files with 28 additions and 53 deletions
|
@ -16,6 +16,10 @@ network_ether_interfaces:
|
||||||
- device: vio1
|
- device: vio1
|
||||||
proto: none
|
proto: none
|
||||||
|
|
||||||
|
unbound_zones:
|
||||||
|
- 20.172.in-addr.arpa
|
||||||
|
- home.foo.sh
|
||||||
|
|
||||||
# use custom firewall config
|
# use custom firewall config
|
||||||
firewall_src: pf.conf.gw_home
|
firewall_src: pf.conf.gw_home
|
||||||
|
|
||||||
|
|
|
@ -11,7 +11,9 @@ network_vip_interfaces:
|
||||||
netmask: 255.255.0.0
|
netmask: 255.255.0.0
|
||||||
pass: "{{ vip26_pass }}"
|
pass: "{{ vip26_pass }}"
|
||||||
|
|
||||||
zm_mysql_host: sqldb02.home.foo.sh
|
unbound_zones:
|
||||||
|
- 26.20.172.in-addr.arpa
|
||||||
|
- cam.foo.sh
|
||||||
dhcpd_template: dhcpd.conf.cam.j2
|
dhcpd_template: dhcpd.conf.cam.j2
|
||||||
|
|
||||||
firewall_in:
|
firewall_in:
|
||||||
|
|
|
@ -2,6 +2,10 @@
|
||||||
datadisks:
|
datadisks:
|
||||||
- {size: 10, type: nvme}
|
- {size: 10, type: nvme}
|
||||||
|
|
||||||
|
unbound_zones:
|
||||||
|
- 25.20.172.in-addr.arpa
|
||||||
|
- oob.foo.sh
|
||||||
|
|
||||||
network_vip_interfaces:
|
network_vip_interfaces:
|
||||||
- device: eth0
|
- device: eth0
|
||||||
vhid: 11
|
vhid: 11
|
||||||
|
|
|
@ -9,6 +9,10 @@ network_vip_interfaces:
|
||||||
|
|
||||||
dhcpd_template: dhcpd.conf.print.j2
|
dhcpd_template: dhcpd.conf.print.j2
|
||||||
|
|
||||||
|
unbound_zones:
|
||||||
|
- 24.20.172.in-addr.arpa
|
||||||
|
- print.foo.sh
|
||||||
|
|
||||||
firewall_in:
|
firewall_in:
|
||||||
- {proto: tcp, port: 22, from: [172.20.20.0/22]}
|
- {proto: tcp, port: 22, from: [172.20.20.0/22]}
|
||||||
- {proto: tcp, port: 53, from: [172.20.24.0/24]}
|
- {proto: tcp, port: 53, from: [172.20.24.0/24]}
|
||||||
|
|
|
@ -144,19 +144,6 @@
|
||||||
tags: certificates
|
tags: certificates
|
||||||
notify: Restart unbound
|
notify: Restart unbound
|
||||||
|
|
||||||
- name: Copy DNS zone files
|
|
||||||
ansible.builtin.copy:
|
|
||||||
dest: "/var/unbound/db/{{ item }}"
|
|
||||||
src: "/srv/dns/{{ item }}"
|
|
||||||
mode: "0644"
|
|
||||||
owner: root
|
|
||||||
group: "{{ ansible_wheel }}"
|
|
||||||
tags: dns
|
|
||||||
notify: Restart unbound
|
|
||||||
with_items:
|
|
||||||
- 20.172.in-addr.arpa
|
|
||||||
- home.foo.sh
|
|
||||||
|
|
||||||
- name: Import unbound role
|
- name: Import unbound role
|
||||||
ansible.builtin.import_role:
|
ansible.builtin.import_role:
|
||||||
name: unbound
|
name: unbound
|
||||||
|
|
|
@ -35,19 +35,6 @@
|
||||||
- name: Run handlers to get interfaces configured
|
- name: Run handlers to get interfaces configured
|
||||||
ansible.builtin.meta: flush_handlers
|
ansible.builtin.meta: flush_handlers
|
||||||
|
|
||||||
- name: Copy DNS zone files
|
|
||||||
ansible.builtin.copy:
|
|
||||||
dest: "/var/lib/unbound/{{ item }}"
|
|
||||||
src: "/srv/dns/{{ item }}"
|
|
||||||
mode: "0644"
|
|
||||||
owner: root
|
|
||||||
group: "{{ ansible_wheel }}"
|
|
||||||
tags: dns
|
|
||||||
notify: Restart unbound
|
|
||||||
with_items:
|
|
||||||
- 26.20.172.in-addr.arpa
|
|
||||||
- cam.foo.sh
|
|
||||||
|
|
||||||
- name: Include unbound role
|
- name: Include unbound role
|
||||||
ansible.builtin.import_role:
|
ansible.builtin.import_role:
|
||||||
name: unbound
|
name: unbound
|
||||||
|
|
|
@ -46,19 +46,6 @@
|
||||||
vars:
|
vars:
|
||||||
relay_domains: [foo.sh]
|
relay_domains: [foo.sh]
|
||||||
|
|
||||||
- name: Copy DNS zone files
|
|
||||||
ansible.builtin.copy:
|
|
||||||
dest: "/var/lib/unbound/{{ item }}"
|
|
||||||
src: "/srv/dns/{{ item }}"
|
|
||||||
mode: "0644"
|
|
||||||
owner: root
|
|
||||||
group: "{{ ansible_wheel }}"
|
|
||||||
tags: dns
|
|
||||||
notify: Restart unbound
|
|
||||||
with_items:
|
|
||||||
- 25.20.172.in-addr.arpa
|
|
||||||
- oob.foo.sh
|
|
||||||
|
|
||||||
- name: Import unbound role
|
- name: Import unbound role
|
||||||
ansible.builtin.import_role:
|
ansible.builtin.import_role:
|
||||||
name: unbound
|
name: unbound
|
||||||
|
|
|
@ -25,19 +25,6 @@
|
||||||
ansible.builtin.import_role:
|
ansible.builtin.import_role:
|
||||||
name: dhcpd
|
name: dhcpd
|
||||||
|
|
||||||
- name: Copy DNS zone files
|
|
||||||
ansible.builtin.copy:
|
|
||||||
dest: "/var/lib/unbound/{{ item }}"
|
|
||||||
src: "/srv/dns/{{ item }}"
|
|
||||||
mode: "0644"
|
|
||||||
owner: root
|
|
||||||
group: "{{ ansible_wheel }}"
|
|
||||||
tags: dns
|
|
||||||
notify: Restart unbound
|
|
||||||
with_items:
|
|
||||||
- 24.20.172.in-addr.arpa
|
|
||||||
- print.foo.sh
|
|
||||||
|
|
||||||
- name: Install unbound role
|
- name: Install unbound role
|
||||||
ansible.builtin.import_role:
|
ansible.builtin.import_role:
|
||||||
name: unbound
|
name: unbound
|
||||||
|
|
|
@ -15,6 +15,17 @@
|
||||||
creates: "{{ unbound_control_key }}"
|
creates: "{{ unbound_control_key }}"
|
||||||
notify: Restart unbound
|
notify: Restart unbound
|
||||||
|
|
||||||
|
- name: Copy zone files
|
||||||
|
ansible.builtin.copy:
|
||||||
|
dest: "{{ unbound_zonedir }}/{{ item }}"
|
||||||
|
src: "/srv/dns/{{ item }}"
|
||||||
|
mode: "0644"
|
||||||
|
owner: root
|
||||||
|
group: "{{ ansible_wheel }}"
|
||||||
|
with_items: "{{ unbound_zones }}"
|
||||||
|
notify: Restart unbound
|
||||||
|
when: unbound_zones is defined
|
||||||
|
|
||||||
- name: Copy config
|
- name: Copy config
|
||||||
ansible.builtin.template:
|
ansible.builtin.template:
|
||||||
dest: "{{ unbound_conf }}"
|
dest: "{{ unbound_conf }}"
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
---
|
---
|
||||||
unbound_conf: /var/unbound/etc/unbound.conf
|
unbound_conf: /var/unbound/etc/unbound.conf
|
||||||
unbound_control_key: /var/unbound/etc/unbound_control.key
|
unbound_control_key: /var/unbound/etc/unbound_control.key
|
||||||
|
unbound_zonedir: /var/unbound/db
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
---
|
---
|
||||||
unbound_conf: /etc/unbound/unbound.conf
|
unbound_conf: /etc/unbound/unbound.conf
|
||||||
unbound_control_key: /etc/unbound/unbound_control.key
|
unbound_control_key: /etc/unbound/unbound_control.key
|
||||||
|
unbound_zonedir: /var/lib/unbound
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue