remove config
This commit is contained in:
parent
65b65aba7f
commit
02b3954c98
6 changed files with 0 additions and 95 deletions
|
@ -1,4 +0,0 @@
|
|||
---
|
||||
- hosts: all
|
||||
roles:
|
||||
- knot
|
|
@ -1,3 +0,0 @@
|
|||
---
|
||||
zones_dir: "{{ lookup('env', 'ZONE_DIR') | default('../zones', True) }}"
|
||||
zones: "{{ lookup('fileglob', zones_dir + '/*.zone', wantlist=True)}}"
|
|
@ -1,5 +0,0 @@
|
|||
[primary]
|
||||
dev-ns1.vm ansible_user=roger
|
||||
|
||||
[secondary]
|
||||
dev-ns2.vm ansible_user=roger
|
|
@ -1,5 +0,0 @@
|
|||
---
|
||||
- name: reload knot
|
||||
become: yes
|
||||
command:
|
||||
cmd: knotc reload
|
|
@ -1,33 +0,0 @@
|
|||
---
|
||||
- name: Install knot
|
||||
become: yes
|
||||
apt:
|
||||
update_cache: yes
|
||||
pkg:
|
||||
- knot
|
||||
- knot-dnsutils
|
||||
|
||||
- name: Update zones
|
||||
become: yes
|
||||
ansible.builtin.copy:
|
||||
src: '{{ zones_dir }}/'
|
||||
dest: /var/lib/knot/zones
|
||||
owner: knot
|
||||
group: knot
|
||||
mode: '0644'
|
||||
notify: reload knot
|
||||
when: "inventory_hostname in groups.primary"
|
||||
|
||||
- name: Deploy conf
|
||||
become: yes
|
||||
template:
|
||||
src: knot.conf.j2
|
||||
dest: /etc/knot/knot.conf
|
||||
notify: reload knot
|
||||
|
||||
- name: Start knot
|
||||
become: yes
|
||||
service:
|
||||
name: knot
|
||||
state: started
|
||||
enabled: yes
|
|
@ -1,45 +0,0 @@
|
|||
server:
|
||||
rundir: "/run/knot"
|
||||
user: knot:knot
|
||||
listen: [ 0.0.0.0@53, ::@53 ]
|
||||
|
||||
log:
|
||||
- target: syslog
|
||||
any: info
|
||||
|
||||
remote:
|
||||
{% for host in groups.all %}
|
||||
- id: {{ hostvars[host].ansible_hostname }}
|
||||
address: [ {{ ( hostvars[host].ansible_all_ipv4_addresses + hostvars[host].ansible_all_ipv6_addresses ) | ansible.netcommon.ipaddr('public') | join(', ') }} ]
|
||||
{% endfor %}
|
||||
|
||||
acl:
|
||||
{% for host in groups.all %}
|
||||
- id: {{ hostvars[host].ansible_hostname }}
|
||||
address: [ {{ ( hostvars[host].ansible_all_ipv4_addresses + hostvars[host].ansible_all_ipv6_addresses ) | ansible.netcommon.ipaddr('public') | join(', ') }} ]
|
||||
action: {% if host in groups.secondary %} transfer {% elif host in groups.primary %} notify {% endif %}
|
||||
|
||||
{% endfor %}
|
||||
|
||||
template:
|
||||
- id: default
|
||||
storage: "/var/lib/knot"
|
||||
file: "zones/%s.zone"
|
||||
|
||||
{% if inventory_hostname in groups.primary %}
|
||||
zonefile-load: difference-no-serial
|
||||
dnssec-signing: on
|
||||
dnssec-policy: default
|
||||
notify: [ {{ groups.secondary | map('extract', hostvars) | map(attribute='ansible_hostname') | join(', ') }} ]
|
||||
acl: [ {{ groups.secondary | map('extract', hostvars) | map(attribute='ansible_hostname') | join(', ') }} ]
|
||||
{% endif %}
|
||||
|
||||
{% if inventory_hostname in groups.secondary %}
|
||||
master: [ {{ groups.primary | map('extract', hostvars) | map(attribute='ansible_hostname') | join(', ') }} ]
|
||||
acl: [ {{ groups.primary | map('extract', hostvars) | map(attribute='ansible_hostname') | join(', ') }} ]
|
||||
{% endif %}
|
||||
|
||||
zone:
|
||||
{% for zone in zones %}
|
||||
- domain: {{ zone | basename | splitext | first }}
|
||||
{% endfor %}
|
Loading…
Reference in a new issue