summaryrefslogtreecommitdiff
path: root/roles/bind
diff options
context:
space:
mode:
authorChristian Pointner <equinox@spreadspace.org>2022-06-19 00:03:22 +0200
committerChristian Pointner <equinox@spreadspace.org>2022-06-19 00:03:22 +0200
commitd5cb307d443301e96a06c80e4608ec7e9d015e0e (patch)
tree3a52b762ae29ec9e17b84ca05c3ecbc8e3e8c9b8 /roles/bind
parentadd simple handling for nftable rulesets in base role (diff)
import improved bind role from helsinki repo
Diffstat (limited to 'roles/bind')
-rw-r--r--roles/bind/defaults/main.yml14
-rw-r--r--roles/bind/handlers/main.yml5
-rw-r--r--roles/bind/tasks/main.yml109
-rw-r--r--roles/bind/templates/slave-zones.j222
4 files changed, 0 insertions, 150 deletions
diff --git a/roles/bind/defaults/main.yml b/roles/bind/defaults/main.yml
deleted file mode 100644
index e5b4c688..00000000
--- a/roles/bind/defaults/main.yml
+++ /dev/null
@@ -1,14 +0,0 @@
----
-## options
-
-# bind_option_empty_zones_enable: yes
-# bind_option_allow_transfer: []
-# bind_option_allow_recursion: []
-# bind_option_notify: no
-
-
-## zone configs
-
-# bind_empty_onion_zone: no
-# bind_master_zones: ...
-# bind_slave_zones: ...
diff --git a/roles/bind/handlers/main.yml b/roles/bind/handlers/main.yml
deleted file mode 100644
index 1bb588c7..00000000
--- a/roles/bind/handlers/main.yml
+++ /dev/null
@@ -1,5 +0,0 @@
----
-- name: reload bind
- systemd:
- name: bind9
- state: reloaded
diff --git a/roles/bind/tasks/main.yml b/roles/bind/tasks/main.yml
deleted file mode 100644
index 92e37e6a..00000000
--- a/roles/bind/tasks/main.yml
+++ /dev/null
@@ -1,109 +0,0 @@
----
-- name: install bind
- apt:
- name: bind9
- state: present
-
-- name: set bind options
- blockinfile:
- path: /etc/bind/named.conf.options
- block: |
- {% if bind_option_empty_zones_enable is defined %}
- empty-zones-enable {% if bind_option_empty_zones_enable %}yes{% else %}no{% endif %};
- {% endif %}
- {% if bind_option_notify is defined %}
- notify {% if bind_option_notify %}yes{% else %}no{% endif %};
- {% endif %}
- {% if bind_option_allow_transfer is defined %}
-
- allow-transfer {
- {% for item in bind_option_allow_transfer %}
- {{ item }};
- {% endfor %}
- };
- {% endif %}
- {% if bind_option_allow_recursion is defined %}
-
- allow-recursion {
- {% for item in bind_option_allow_recursion %}
- {{ item }};
- {% endfor %}
- };
- {% endif %}
- insertbefore: '};'
- marker: " // {mark} ansible managed block"
- notify: reload bind
-
-
-- name: add empty .onion zone
- when: bind_empty_onion_zone
- copy:
- dest: /etc/bind/named.conf.onion
- content: |
- // block .onion addresses
- zone "onion" {
- type master;
- file "/etc/bind/db.empty";
- notify no;
- };
- notify: reload bind
-
-- name: remove empty .onion zone
- when: not bind_empty_onion_zone
- file:
- path: /etc/bind/named.conf.onion
- state: absent
- notify: reload bind
-
-- name: enable/disable empty .onion zone
- lineinfile:
- path: /etc/bind/named.conf
- line: 'include "/etc/bind/named.conf.onion";'
- state: "{% if bind_empty_onion_zone %}present{% else %}absent{% endif %}"
- notify: reload bind
-
-
-- name: add slave zone configuration
- when: bind_slave_zones is defined
- template:
- src: slave-zones.j2
- dest: /etc/bind/named.conf.slave-zones
- notify: reload bind
-
-- name: remove slave zone configuration
- when: bind_slave_zones is not defined
- file:
- path: /etc/bind/named.conf.slave-zones
- state: absent
- notify: reload bind
-
-- name: enable/disable slave zone configuration
- lineinfile:
- path: /etc/bind/named.conf
- line: 'include "/etc/bind/named.conf.slave-zones";'
- state: "{% if bind_slave_zones is defined %}present{% else %}absent{% endif %}"
- notify: reload bind
-
-
-# - name: add master zone configuration
-# when: bind_master_zones is defined
-# template:
-# src: master-zones.j2
-# dest: /etc/bind/named.conf.master-zones
-# notify: reload bind
-
-# - name: remove master zone configuration
-# when: bind_master_zones is not defined
-# file:
-# path: /etc/bind/named.conf.master-zones
-# state: absent
-# notify: reload bind
-
-# ## TODO: install zone files for master zones
-
-# - name: enable/disable master zone configuration
-# lineinfile:
-# path: /etc/bind/named.conf
-# line: 'include "/etc/bind/named.conf.master-zones";'
-# state: "{% if bind_master_zones is defined %}present{% else %}absent{% endif %}"
-# notify: reload bind
diff --git a/roles/bind/templates/slave-zones.j2 b/roles/bind/templates/slave-zones.j2
deleted file mode 100644
index da9ba699..00000000
--- a/roles/bind/templates/slave-zones.j2
+++ /dev/null
@@ -1,22 +0,0 @@
-// Masters
-
-{% for group in bind_slave_zones %}
-masters {{ group.name }} {
-{% for master in group.masters %}
- {{ master }};
-{% endfor %}
-};
-
-{% endfor %}
-
-// Zones
-{% for group in bind_slave_zones %}
-{% for zone in group.zones %}
-
-zone "{{ zone }}" {
- type slave;
- file "/var/cache/bind/db.{{ zone }}.sec";
- masters { {{ group.name }}; };
-};
-{% endfor %}
-{% endfor %}