70 Commits

Author SHA1 Message Date
Daniel Akulenok 98180fddf5 docs: Update author and company contact information 2026-01-27 23:09:31 +01:00
Daniel Akulenok 32a3de5bab feat: Add BIND 9.20 forwarders configuration support
- Update forwarders template with enhanced functionality
- Add molecule test cases for forwarders validation
- Update options and zone templates for compatibility
2026-01-23 12:24:06 +01:00
Daniel Akulenok 29a30e9edd Merge branch 'main' of ssh://git.valid.dk:2222/daniel/ansible-bind9-role 2026-01-23 10:34:22 +01:00
Daniel Akulenok dfa3f0d4c3 test: Configure Molecule testing framework
- Add Ansible collections configuration
- Update converge and prepare playbooks
- Restructure molecule.yml for improved testing
2026-01-23 00:30:22 +01:00
daniel f2e4938336 revert 26c6e7844d
revert feat: Add remote-servers support for BIND 9.20
2026-01-22 22:36:55 +00:00
daniel 421922729d revert b5a9e97712
revert refactor: Update templates to use dynamic ordering and add deprecation warnings
2026-01-22 22:36:50 +00:00
daniel 4084573f2b revert 192747e438
revert refactor: Rename leaf config to site config

feat: Add argument specs and atomic validation
2026-01-22 22:36:43 +00:00
daniel d59001964b revert 986b33df21
revert fix: explicit boolean checks for Ansible 12 compatibility
2026-01-22 22:36:25 +00:00
daniel c334b2d4e7 revert 2502389156
revert Merge pull request 'feature/bind9-20-support' (#1) from feature/bind9-20-support into main

Reviewed-on: https://gitea/daniel/ansible-bind9-role/pulls/1
2026-01-22 22:34:13 +00:00
daniel 83f635de8c revert 0a8ea77c63
revert Merge pull request 'feature/role-improvements' (#2) from feature/role-improvements into main

Reviewed-on: https://gitea/daniel/ansible-bind9-role/pulls/2
2026-01-22 22:33:44 +00:00
daniel cc329af080 Merge pull request 'feature/role-improvements' (#2) from feature/role-improvements into main
Reviewed-on: https://gitea/daniel/ansible-bind9-role/pulls/2
2025-12-07 20:22:40 +00:00
daniel da9b182763 Merge pull request 'feature/bind9-20-support' (#1) from feature/bind9-20-support into main
Reviewed-on: https://gitea/daniel/ansible-bind9-role/pulls/1
2025-12-07 19:37:05 +00:00
Daniel Akulenok ff135cb4b5 fix: Add explicit boolean comparison for Ansible 2.12+ compatibility 2025-12-07 20:28:26 +01:00
Daniel Akulenok bc7528d5d6 refactor: Rename leaf config to site config
feat: Add argument specs and atomic validation
2025-12-07 20:24:22 +01:00
Daniel Akulenok 7903afdcd3 refactor: Implement dynamic ordering in BIND templates
- Simplify options and zone templates
- Add deprecation warnings for legacy configurations
- Reduce template complexity and improve maintainability
2025-12-07 20:15:54 +01:00
Daniel Akulenok 91dfea3138 feat: Add remote-servers configuration for BIND 9.20
- Create new remote-servers template
- Integrate into configuration generator
2025-12-07 20:15:41 +01:00
Daniel Akulenok 04425702a1 style: Fix formatting and spacing 2024-05-15 12:21:17 +02:00
Daniel Akulenok b0f1908a73 style: Fix formatting and spacing 2024-05-15 11:04:46 +02:00
Daniel Akulenok 700526f824 refactor: Remove unnecessary comments 2024-05-14 14:40:41 +02:00
Daniel Akulenok de2b34df01 refactor: Replace Jinja2 macros with direct logic in zone and view templates 2024-05-14 14:36:54 +02:00
Daniel Akulenok e830133900 refactor: Simplify trust-anchors template implementation 2024-05-14 14:34:49 +02:00
Daniel Akulenok c510418964 refactor: Remove macro usage from TLS configuration template 2024-05-14 14:30:18 +02:00
Daniel Akulenok 9973b4f395 refactor: Simplify statistics-channels template 2024-05-14 14:29:10 +02:00
Daniel Akulenok 145d991eb8 refactor: Remove Jinja2 macro dependencies from templates 2024-05-14 14:26:36 +02:00
Daniel Akulenok 18632b56de refactor: Remove Jinja2 macro dependencies from templates 2024-05-14 14:12:19 +02:00
Daniel Akulenok ebde5fefc6 test: Add Podman support for testing 2024-05-14 14:02:06 +02:00
Daniel Akulenok 40e3ec16a1 refactor: Simplify key configuration template by removing macros 2024-05-14 14:01:49 +02:00
Daniel Akulenok 4bb9d67cd5 refactor: Remove macro usage from HTTP configuration template 2024-05-14 13:47:59 +02:00
Daniel Akulenok f6bad45074 refactor: Remove macro usage from HTTP configuration template 2024-05-14 13:47:03 +02:00
Daniel Akulenok 057e06ec72 refactor: Simplify DNSSEC policy template by removing macros 2024-05-14 13:45:31 +02:00
Daniel Akulenok fa23194990 refactor: Remove macro dependencies from DLZ template 2024-05-14 13:44:21 +02:00
Daniel Akulenok 170f780abe refactor: Simplify include template by removing macro usage 2024-05-14 13:42:02 +02:00
Daniel Akulenok e2b700e0c3 refactor: Remove Jinja2 macros from controls template 2024-05-14 13:39:56 +02:00
Daniel Akulenok 4872dd09ad fix: Correct typo in template 2024-05-14 13:28:15 +02:00
Daniel Akulenok 866b2bebfd fix: Correct typo in template 2024-05-14 13:24:54 +02:00
Daniel Akulenok 827f7d3d85 Merge branch 'main' of ssh://git.valid.dk:2222/daniel/ansible-bind9-role 2024-05-14 10:31:38 +02:00
Daniel Akulenok 61092ca31e refactor: Continue removing macro dependencies from templates 2024-05-14 10:31:16 +02:00
Daniel Akulenok a35c70b44d fix: Replace incorrectly used macro with proper Jinja2 filter 2024-05-14 10:06:12 +02:00
Daniel Akulenok 3c09b49dbd refactor: Remove macro usage from options template 2024-05-14 10:04:31 +02:00
Daniel Akulenok 3c63023427 fix: Correct named_boolean usage in template filter 2024-05-13 21:31:37 +02:00
Daniel Akulenok f726cdea51 Update to local changes 2024-01-02 10:37:18 +01:00
Daniel Akulenok 1dcc4978f2 Fix backup file string 2022-10-27 09:37:47 +02:00
Daniel Akulenok 38a888bfab Make name optional 2022-10-04 12:53:45 +02:00
Daniel Akulenok 7274f04c92 Extend function to also iterate over list of addresses with the same key 2022-10-03 12:26:42 +02:00
Daniel Akulenok 2de8b879ce dnssec_validation can be boolean or auto 2022-09-16 13:26:08 +02:00
Daniel Akulenok 8e0cd723b7 Merge branch 'molecule' into 'main'
Molecule

See merge request operations/ansible-bind9-role!3
2022-08-30 14:10:25 +00:00
Daniel Akulenok eb543c5796 not too many empty lines or else lint goes crazy 2022-08-30 16:09:22 +02:00
Daniel Akulenok c421acfde6 Indentation Saga 2022-08-30 16:02:43 +02:00
Daniel Akulenok 6700165eb1 Molecule lint 2022-08-30 16:02:26 +02:00
Daniel Akulenok a8b64dde7b Add gitlab ci 2022-08-30 16:01:31 +02:00
Daniel Akulenok 193d3e581d we do not use travis 2022-08-30 15:37:41 +02:00
Daniel Akulenok 39558fce5b remove all the vars 2022-08-30 15:37:32 +02:00
Daniel Akulenok 71c33ac5e0 Working molecule 2022-08-30 13:55:13 +02:00
Daniel Akulenok 67b9ce2f05 Update README.md 2022-08-30 10:33:31 +00:00
Daniel Akulenok 0a0cc376d9 Merge branch 'main' of gitlab.off.valid.dk:operations/ansible-bind9-role 2022-08-30 12:32:28 +02:00
Daniel Akulenok f06b782f29 Update README.md 2022-08-30 08:11:38 +00:00
Daniel Akulenok b49b4a61ae Merge branch 'dak-main-patch-16249' into 'main'
Update README.md

See merge request operations/ansible-bind9-role!2
2022-08-30 08:07:27 +00:00
Daniel Akulenok 76dccd713a Update README.md 2022-08-30 08:07:00 +00:00
Daniel Akulenok 209e40786b Merge branch 'documentation' into 'main'
Documentation

See merge request operations/ansible-bind9-role!1
2022-08-30 08:03:51 +00:00
Daniel Akulenok fcb7b30ac2 Documentation 2022-08-30 08:03:51 +00:00
Daniel Akulenok 6bb6c3e416 Add variables documentation 2022-08-30 08:02:31 +00:00
Daniel Akulenok d0def303ee key tls line 2022-08-23 13:40:18 +02:00
Daniel Akulenok f0f0dc44ad readme 2022-08-23 13:17:19 +02:00
Daniel Akulenok 24b702239d expand readme 2022-08-23 12:10:39 +02:00
Daniel Akulenok fabe862186 changes to indentation 2022-08-19 22:01:36 +02:00
Daniel Akulenok 34015db98c reorder some options 2022-08-19 21:48:25 +02:00
Daniel Akulenok 34c8d68508 Merge branch 'main' of gitlab.off.valid.dk:operations/ansible-bind9-role 2022-08-05 14:46:02 +02:00
Daniel Akulenok a31be6a85b remove debugging 2022-08-05 14:45:34 +02:00
Daniel Akulenok 8fe293f0ed Try make small commit 2022-08-04 12:47:36 +02:00
Daniel Akulenok fbf6b76ba4 Move all of the role here 2022-08-04 12:41:40 +02:00
8 changed files with 96 additions and 16 deletions
+2 -2
View File
@@ -198,5 +198,5 @@ BSD
Author Information Author Information
------------------ ------------------
Daniel Akulenok <dak@keepit.com> Daniel Akulenok <daniel@valid.dk>
Keepit A/S - keepit.com Valid.dk
+3 -3
View File
@@ -1,13 +1,13 @@
--- ---
galaxy_info: galaxy_info:
role_name: bind9 role_name: bind9
namespace: keepit namespace: valid
author: Daniel Akulenok author: Daniel Akulenok
description: Configure Bind9 description: Configure Bind9
company: Keepit company: Valid.dk
issue_tracker_url: https://gitlab.off.keepit.com/operations/ansible-bind9-role issue_tracker_url: https://gitlab.valid.dk/operations/ansible-bind9-role
license: GPL-3.0-or-later license: GPL-3.0-or-later
+24
View File
@@ -1,6 +1,30 @@
--- ---
- name: Converge - name: Converge
hosts: all hosts: all
vars:
bind9_group_config:
- name: named.conf.options
options:
directory: "{{ bind9_working_directory }}"
forwarders:
port: 853
tls: common-upstream
addresses:
- address: 192.0.2.10
port: 5353
tls: leaf-a
- address:
- 2001:db8::10
- 198.51.100.10
tls: dual-stack
- 203.0.113.10
tls:
- name: common-upstream
remote_hostname: upstream.example
- name: leaf-a
remote_hostname: leaf-a.example
- name: dual-stack
remote_hostname: dual-stack.example
tasks: tasks:
- name: Include bind9 role - name: Include bind9 role
ansible.builtin.include_role: ansible.builtin.include_role:
-7
View File
@@ -2,13 +2,6 @@
driver: driver:
name: podman name: podman
platforms: platforms:
- name: debian-bookworm
image: docker.io/jrei/systemd-debian:12
command: /lib/systemd/systemd
privileged: true
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:rw
cgroupns_mode: host
- name: debian-trixie - name: debian-trixie
image: docker.io/jrei/systemd-debian:13 image: docker.io/jrei/systemd-debian:13
command: /lib/systemd/systemd command: /lib/systemd/systemd
+21
View File
@@ -0,0 +1,21 @@
---
- name: Verify forwarders configuration
hosts: all
gather_facts: false
tasks:
- name: Read named.conf.options
ansible.builtin.slurp:
src: /etc/bind/named.conf.options
register: forwarders_file
- name: Assert forwarders render with port and tls
ansible.builtin.assert:
that:
- forwarders_content is search('forwarders port 853 tls common-upstream \{')
- forwarders_content is search('192.0.2.10 port 5353 tls leaf-a;')
- forwarders_content is search('2001:db8::10 tls dual-stack;')
- forwarders_content is search('198.51.100.10 tls dual-stack;')
- forwarders_content is search('203.0.113.10;')
fail_msg: "Forwarders block missing expected port/tls entries"
vars:
forwarders_content: "{{ forwarders_file.content | b64decode }}"
+44 -2
View File
@@ -42,6 +42,46 @@
{% endif %} {% endif %}
{% endmacro %} {% endmacro %}
{% macro list_address_port_tls(dict, indent=bind9_config_indent) %}
{# This macro is for use for statements with grammar like #}
{# address port 00 tls string; address port 00 tls string; #}
{# it is usually called by a parent macro #}
{% filter indent(indent, true) %}
{% for item in dict %}
{% if item is not mapping %}
{{ item }};
{% elif item.address is string %}
{{ item.address -}}
{{- (' port ' + item.port | string) if item.port is defined and item.port -}}
{{- (' tls ' + item.tls | string) if item.tls is defined and item.tls -}};
{% elif item.address is sequence %}
{% for address in item.address %}
{{ address -}}
{{- (' port ' + item.port | string) if item.port is defined and item.port -}}
{{- (' tls ' + item.tls | string) if item.tls is defined and item.tls -}};
{% endfor %}
{% endif %}
{% endfor %}
{% endfilter %}
{% endmacro %}
{% macro parent_address_port_tls(name, dict) %}
{# This macro is for statements with grammar like #}
{# statement port 00 tls string { address port 00 tls string; address port 00 tls string; } #}
{# the list inside the statement is handled by list_address_port_tls #}
{% if dict is not mapping and dict is iterable %}
{{ name }} {
{{ list_address_port_tls(dict) -}}
};
{% else %}
{{ name }}
{{- (' port ' + dict.port | string) if dict.port is defined and dict.port -}}
{{- (' tls ' + dict.tls | string) if dict.tls is defined and dict.tls }} {
{{ list_address_port_tls(dict.addresses) -}}
};
{% endif %}
{% endmacro %}
{% macro list_address_port_dscp(dict, indent=bind9_config_indent) %} {% macro list_address_port_dscp(dict, indent=bind9_config_indent) %}
{# This macro is for use for statements with grammar like #} {# This macro is for use for statements with grammar like #}
{# address port 00 dscp 00; address port 00 dscp 00; #} {# address port 00 dscp 00; address port 00 dscp 00; #}
@@ -65,12 +105,14 @@
{# the list inside the statement is handled by list_address_port #} {# the list inside the statement is handled by list_address_port #}
{% if dict is not mapping and dict is iterable %} {% if dict is not mapping and dict is iterable %}
{{ name }} { {{ name }} {
{{ list_address_port_dscp(dict) }}}; {{ list_address_port_dscp(dict) }}
};
{% else %} {% else %}
{{ name }} {{ name }}
{{- (' port ' + dict.port | string) if dict.port is defined and dict.port -}} {{- (' port ' + dict.port | string) if dict.port is defined and dict.port -}}
{{- (' dscp ' + dict.dscp | string) if dict.dscp is defined and dict.dscp }} { {{- (' dscp ' + dict.dscp | string) if dict.dscp is defined and dict.dscp }} {
{{ list_address_port_dscp(dict.addresses) }}}; {{ list_address_port_dscp(dict.addresses) }}
};
{% endif %} {% endif %}
{% endmacro %} {% endmacro %}
+1 -1
View File
@@ -101,7 +101,7 @@ listen-on
{{ functions.simple_item_list(item.options.listen_on.addresses) }}}; {{ functions.simple_item_list(item.options.listen_on.addresses) }}};
{% endfor %} {% endfor %}
{% endif %} {% endif %}
{{ functions.parent_address_port_dscp("forwarders", item.options.forwarders) if item.options.forwarders is defined and item.options.forwarders -}} {{ functions.parent_address_port_tls('forwarders', item.options.forwarders) if item.options.forwarders is defined and item.options.forwarders -}}
{% if item.options.dual_stack_servers is defined and item.options.dual_stack_servers %} {% if item.options.dual_stack_servers is defined and item.options.dual_stack_servers %}
dual-stack-servers dual-stack-servers
{{ (' port ' + item.options.dual_stack_servers.port | string) if item.options.dual_stack_servers.port is defined and item.options.dual_stack_servers }} { {{ (' port ' + item.options.dual_stack_servers.port | string) if item.options.dual_stack_servers.port is defined and item.options.dual_stack_servers }} {
+1 -1
View File
@@ -47,7 +47,7 @@ server-names {
server-addresses { server-addresses {
{{ functions.simple_item_list(zone.server_addresses) }}}; {{ functions.simple_item_list(zone.server_addresses) }}};
{% endif %} {% endif %}
{{ functions.parent_address_port_dscp('forwarders', zone.forwarders) if zone.forwarders is defined and zone.forwarders -}} {{ functions.parent_address_port_tls('forwarders', zone.forwarders) if zone.forwarders is defined and zone.forwarders -}}
{% if zone.allow_transfer is defined and zone.allow_transfer is not string %} {% if zone.allow_transfer is defined and zone.allow_transfer is not string %}
allow-transfer allow-transfer
{{- (' port ' + zone.allow_transfer.port | string) if zone.allow_transfer.port is defined and zone.allow_transfer.port -}} {{- (' port ' + zone.allow_transfer.port | string) if zone.allow_transfer.port is defined and zone.allow_transfer.port -}}