4 Commits

4 changed files with 17 additions and 20 deletions
+8 -8
View File
@@ -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,11 @@ 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')
}}
+2 -4
View File
@@ -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
+1 -2
View File
@@ -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
+6 -6
View File
@@ -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,11 +46,11 @@
dest: "{{ bind9_cfgdir }}/{{ item.name }}"
owner: root
group: bind
mode: '0640'
mode: "0640"
loop: "{{ bind9_config }}"
loop_control:
label: "{{ item.name }}"
register: _template_result
register: bind9_template_result
- name: Validate configuration using named-checkconf
ansible.builtin.command:
@@ -65,7 +65,7 @@
remote_src: true
owner: root
group: bind
mode: '0640'
mode: "0640"
loop: "{{ bind9_config }}"
loop_control:
label: "{{ item.name }}"