From cdcc4cbbda7f4a736275d4714decb94c12e954eb Mon Sep 17 00:00:00 2001 From: Daniel Akulenok Date: Fri, 6 Feb 2026 13:38:56 +0100 Subject: [PATCH] fix: standardize YAML formatting and improve readability in bind9 configuration files --- defaults/main.yml | 10 ++-------- handlers/main.yml | 6 ++---- meta/argument_specs.yml | 3 +-- tasks/main.yml | 10 +++++----- 4 files changed, 10 insertions(+), 19 deletions(-) diff --git a/defaults/main.yml b/defaults/main.yml index 34ba28d..69b595d 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -16,7 +16,6 @@ bind9_config_indent: 4 bind9_group_config: [] bind9_site_config: [] bind9_host_config: [] - bind9_default_config: - name: named.conf backup: false @@ -28,10 +27,5 @@ bind9_default_config: options: directory: "{{ bind9_working_directory }}" -bind9_config: "{{ [bind9_default_config, - bind9_group_config, - bind9_site_config, - bind9_host_config] | - community.general.lists_mergeby('name', - recursive=true, - list_merge='append_rp') }}" +bind9_config: "{{ [bind9_default_config, bind9_group_config, bind9_site_config, bind9_host_config] | community.general.lists_mergeby('name', recursive=true, list_merge='append_rp') + }}" diff --git a/handlers/main.yml b/handlers/main.yml index 26a4665..589c245 100644 --- a/handlers/main.yml +++ b/handlers/main.yml @@ -16,10 +16,8 @@ - "{{ bind9_cfgdir }}" - "{{ bind9_working_directory }}" - "{{ bind9_libdir }}" - dest: "{{ - bind9_backup_dir + '/bind9-config-' + - ansible_facts.date_time.iso8601_basic_short + '.tar.gz' }}" + dest: "{{ bind9_backup_dir + '/bind9-config-' + ansible_facts.date_time.iso8601_basic_short + '.tar.gz' }}" owner: root group: root - mode: '0640' + mode: "0640" when: bind9_backup_config is defined and bind9_backup_config diff --git a/meta/argument_specs.yml b/meta/argument_specs.yml index 69ccf1b..fac379f 100644 --- a/meta/argument_specs.yml +++ b/meta/argument_specs.yml @@ -7,8 +7,7 @@ argument_specs: type: list elements: dict description: - - A list of configuration dictionaries that are merged to - produce the final configuration. + - A list of configuration dictionaries that are merged to produce the final configuration. - Each element must have a 'name' key (filename). bind9_default_config: type: list diff --git a/tasks/main.yml b/tasks/main.yml index cddd449..77c17fc 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -15,7 +15,7 @@ state: directory owner: root group: root - mode: '0750' + mode: "0750" when: bind9_backup_config is defined and bind9_backup_config | bool - name: Deploy and Validate Configuration @@ -33,9 +33,9 @@ remote_src: true owner: root group: bind - mode: '0640' + mode: "0640" changed_when: false - failed_when: false # It's okay if the file doesn't exist yet + failed_when: false # It's okay if the file doesn't exist yet loop: "{{ bind9_config }}" loop_control: label: "{{ item.name }}" @@ -46,7 +46,7 @@ dest: "{{ bind9_cfgdir }}/{{ item.name }}" owner: root group: bind - mode: '0640' + mode: "0640" loop: "{{ bind9_config }}" loop_control: label: "{{ item.name }}" @@ -65,7 +65,7 @@ remote_src: true owner: root group: bind - mode: '0640' + mode: "0640" loop: "{{ bind9_config }}" loop_control: label: "{{ item.name }}"