From 02b3954c98a4dcae0a221a9f6473d31e63f5cd55 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABl=20Berthaud-M=C3=BCller?= Date: Fri, 30 Jul 2021 13:39:49 +0200 Subject: [PATCH] remove config --- config/deploy.yml | 4 --- config/group_vars/all | 3 -- config/hosts | 5 --- config/roles/knot/handlers/main.yml | 5 --- config/roles/knot/tasks/main.yml | 33 ----------------- config/roles/knot/templates/knot.conf.j2 | 45 ------------------------ 6 files changed, 95 deletions(-) delete mode 100644 config/deploy.yml delete mode 100644 config/group_vars/all delete mode 100644 config/hosts delete mode 100644 config/roles/knot/handlers/main.yml delete mode 100644 config/roles/knot/tasks/main.yml delete mode 100644 config/roles/knot/templates/knot.conf.j2 diff --git a/config/deploy.yml b/config/deploy.yml deleted file mode 100644 index f25767c..0000000 --- a/config/deploy.yml +++ /dev/null @@ -1,4 +0,0 @@ ---- -- hosts: all - roles: - - knot diff --git a/config/group_vars/all b/config/group_vars/all deleted file mode 100644 index 3e202d7..0000000 --- a/config/group_vars/all +++ /dev/null @@ -1,3 +0,0 @@ ---- -zones_dir: "{{ lookup('env', 'ZONE_DIR') | default('../zones', True) }}" -zones: "{{ lookup('fileglob', zones_dir + '/*.zone', wantlist=True)}}" diff --git a/config/hosts b/config/hosts deleted file mode 100644 index a178558..0000000 --- a/config/hosts +++ /dev/null @@ -1,5 +0,0 @@ -[primary] -dev-ns1.vm ansible_user=roger - -[secondary] -dev-ns2.vm ansible_user=roger diff --git a/config/roles/knot/handlers/main.yml b/config/roles/knot/handlers/main.yml deleted file mode 100644 index 0418a36..0000000 --- a/config/roles/knot/handlers/main.yml +++ /dev/null @@ -1,5 +0,0 @@ ---- -- name: reload knot - become: yes - command: - cmd: knotc reload diff --git a/config/roles/knot/tasks/main.yml b/config/roles/knot/tasks/main.yml deleted file mode 100644 index 81c3f71..0000000 --- a/config/roles/knot/tasks/main.yml +++ /dev/null @@ -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 diff --git a/config/roles/knot/templates/knot.conf.j2 b/config/roles/knot/templates/knot.conf.j2 deleted file mode 100644 index b877fd8..0000000 --- a/config/roles/knot/templates/knot.conf.j2 +++ /dev/null @@ -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 %}