Compare commits
3 Commits
30918dc9f7
...
0271be7752
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0271be7752 | ||
|
|
907735c294 | ||
|
|
cdcc4cbbda |
@@ -16,7 +16,6 @@ bind9_config_indent: 4
|
|||||||
bind9_group_config: []
|
bind9_group_config: []
|
||||||
bind9_site_config: []
|
bind9_site_config: []
|
||||||
bind9_host_config: []
|
bind9_host_config: []
|
||||||
|
|
||||||
bind9_default_config:
|
bind9_default_config:
|
||||||
- name: named.conf
|
- name: named.conf
|
||||||
backup: false
|
backup: false
|
||||||
@@ -28,10 +27,11 @@ bind9_default_config:
|
|||||||
options:
|
options:
|
||||||
directory: "{{ bind9_working_directory }}"
|
directory: "{{ bind9_working_directory }}"
|
||||||
|
|
||||||
bind9_config: "{{ [bind9_default_config,
|
bind9_config: >-
|
||||||
|
{{
|
||||||
|
[bind9_default_config,
|
||||||
bind9_group_config,
|
bind9_group_config,
|
||||||
bind9_site_config,
|
bind9_site_config,
|
||||||
bind9_host_config] |
|
bind9_host_config] |
|
||||||
community.general.lists_mergeby('name',
|
community.general.lists_mergeby('name', recursive=true, list_merge='append_rp')
|
||||||
recursive=true,
|
}}
|
||||||
list_merge='append_rp') }}"
|
|
||||||
|
|||||||
@@ -16,10 +16,8 @@
|
|||||||
- "{{ bind9_cfgdir }}"
|
- "{{ bind9_cfgdir }}"
|
||||||
- "{{ bind9_working_directory }}"
|
- "{{ bind9_working_directory }}"
|
||||||
- "{{ bind9_libdir }}"
|
- "{{ bind9_libdir }}"
|
||||||
dest: "{{
|
dest: "{{ bind9_backup_dir + '/bind9-config-' + ansible_facts.date_time.iso8601_basic_short + '.tar.gz' }}"
|
||||||
bind9_backup_dir + '/bind9-config-' +
|
|
||||||
ansible_facts.date_time.iso8601_basic_short + '.tar.gz' }}"
|
|
||||||
owner: root
|
owner: root
|
||||||
group: root
|
group: root
|
||||||
mode: '0640'
|
mode: "0640"
|
||||||
when: bind9_backup_config is defined and bind9_backup_config
|
when: bind9_backup_config is defined and bind9_backup_config
|
||||||
|
|||||||
@@ -7,8 +7,7 @@ argument_specs:
|
|||||||
type: list
|
type: list
|
||||||
elements: dict
|
elements: dict
|
||||||
description:
|
description:
|
||||||
- A list of configuration dictionaries that are merged to
|
- A list of configuration dictionaries that are merged to produce the final configuration.
|
||||||
produce the final configuration.
|
|
||||||
- Each element must have a 'name' key (filename).
|
- Each element must have a 'name' key (filename).
|
||||||
bind9_default_config:
|
bind9_default_config:
|
||||||
type: list
|
type: list
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
state: directory
|
state: directory
|
||||||
owner: root
|
owner: root
|
||||||
group: root
|
group: root
|
||||||
mode: '0750'
|
mode: "0750"
|
||||||
when: bind9_backup_config is defined and bind9_backup_config | bool
|
when: bind9_backup_config is defined and bind9_backup_config | bool
|
||||||
|
|
||||||
- name: Deploy and Validate Configuration
|
- name: Deploy and Validate Configuration
|
||||||
@@ -33,7 +33,7 @@
|
|||||||
remote_src: true
|
remote_src: true
|
||||||
owner: root
|
owner: root
|
||||||
group: bind
|
group: bind
|
||||||
mode: '0640'
|
mode: "0640"
|
||||||
changed_when: false
|
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: "{{ bind9_config }}"
|
||||||
@@ -46,11 +46,11 @@
|
|||||||
dest: "{{ bind9_cfgdir }}/{{ item.name }}"
|
dest: "{{ bind9_cfgdir }}/{{ item.name }}"
|
||||||
owner: root
|
owner: root
|
||||||
group: bind
|
group: bind
|
||||||
mode: '0640'
|
mode: "0640"
|
||||||
loop: "{{ bind9_config }}"
|
loop: "{{ bind9_config }}"
|
||||||
loop_control:
|
loop_control:
|
||||||
label: "{{ item.name }}"
|
label: "{{ item.name }}"
|
||||||
register: _template_result
|
register: bind9_template_result
|
||||||
|
|
||||||
- name: Validate configuration using named-checkconf
|
- name: Validate configuration using named-checkconf
|
||||||
ansible.builtin.command:
|
ansible.builtin.command:
|
||||||
@@ -65,7 +65,7 @@
|
|||||||
remote_src: true
|
remote_src: true
|
||||||
owner: root
|
owner: root
|
||||||
group: bind
|
group: bind
|
||||||
mode: '0640'
|
mode: "0640"
|
||||||
loop: "{{ bind9_config }}"
|
loop: "{{ bind9_config }}"
|
||||||
loop_control:
|
loop_control:
|
||||||
label: "{{ item.name }}"
|
label: "{{ item.name }}"
|
||||||
|
|||||||
Reference in New Issue
Block a user