Molecule lint
This commit is contained in:
@@ -28,4 +28,10 @@ bind9_default_config:
|
|||||||
options:
|
options:
|
||||||
directory: "{{ bind9_working_directory }}"
|
directory: "{{ bind9_working_directory }}"
|
||||||
|
|
||||||
bind9_config: "{{ [bind9_default_config, bind9_group_config, bind9_leaf_config, bind9_host_config] | community.general.lists_mergeby('name', recursive=true, list_merge='append_rp') }}"
|
bind9_config: "{{ [bind9_default_config,
|
||||||
|
bind9_group_config,
|
||||||
|
bind9_leaf_config,
|
||||||
|
bind9_host_config] |
|
||||||
|
community.general.lists_mergeby('name',
|
||||||
|
recursive=true,
|
||||||
|
list_merge='append_rp') }}"
|
||||||
|
|||||||
@@ -1,23 +1,26 @@
|
|||||||
---
|
---
|
||||||
# handlers file for bind9
|
# handlers file for bind9
|
||||||
- name: reload bind
|
- name: Reload bind
|
||||||
ansible.builtin.service:
|
ansible.builtin.service:
|
||||||
name: named
|
name: named
|
||||||
state: reloaded
|
state: reloaded
|
||||||
|
|
||||||
- name: restart bind
|
- name: Restart bind
|
||||||
ansible.builtin.service:
|
ansible.builtin.service:
|
||||||
name: named
|
name: named
|
||||||
state: restarted
|
state: restarted
|
||||||
|
|
||||||
- name: backup bind config
|
- name: Backup bind config
|
||||||
community.general.archive:
|
community.general.archive:
|
||||||
path:
|
path:
|
||||||
- "{{ bind9_cfgdir }}"
|
- "{{ bind9_cfgdir }}"
|
||||||
- "{{ bind9_working_directory }}"
|
- "{{ bind9_working_directory }}"
|
||||||
- "{{ bind9_libdir }}"
|
- "{{ bind9_libdir }}"
|
||||||
dest: "{{ bind9_backup_dir }}/bind9-config-{{ ansible_date_time.iso8601_basic_short }}.tar.gz"
|
dest: >
|
||||||
|
{{ bind9_backup_dir }}/
|
||||||
|
bind9-config-
|
||||||
|
{{ ansible_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
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
---
|
||||||
galaxy_info:
|
galaxy_info:
|
||||||
role_name: bind9
|
role_name: bind9
|
||||||
namespace: keepit
|
namespace: keepit
|
||||||
@@ -10,18 +11,18 @@ galaxy_info:
|
|||||||
|
|
||||||
license: GPL-3.0-or-later
|
license: GPL-3.0-or-later
|
||||||
|
|
||||||
min_ansible_version: 2.13
|
min_ansible_version: "2.13"
|
||||||
|
|
||||||
platforms:
|
platforms:
|
||||||
- name: Ubuntu
|
- name: Ubuntu
|
||||||
versions:
|
versions:
|
||||||
- 22.04
|
- jammy
|
||||||
- 20.04
|
- focal
|
||||||
- name: Debian
|
- name: Debian
|
||||||
versions:
|
versions:
|
||||||
- 11
|
- bullseye
|
||||||
|
|
||||||
galaxy_tags:
|
galaxy_tags:
|
||||||
- bind9
|
- bind9
|
||||||
- bind
|
- bind
|
||||||
- dns
|
- dns
|
||||||
|
|||||||
@@ -16,3 +16,7 @@ provisioner:
|
|||||||
name: ansible-lint
|
name: ansible-lint
|
||||||
verifier:
|
verifier:
|
||||||
name: ansible
|
name: ansible
|
||||||
|
lint: |
|
||||||
|
set -e
|
||||||
|
yamllint .
|
||||||
|
ansible-lint .
|
||||||
|
|||||||
@@ -18,12 +18,13 @@
|
|||||||
mode: 0750
|
mode: 0750
|
||||||
when: bind9_backup_config is defined and bind9_backup_config
|
when: bind9_backup_config is defined and bind9_backup_config
|
||||||
|
|
||||||
- name: named.conf.generator
|
- name: Template named.conf.generator
|
||||||
ansible.builtin.template:
|
ansible.builtin.template:
|
||||||
src: named.conf.generator.j2
|
src: named.conf.generator.j2
|
||||||
dest: "{{ bind9_cfgdir }}/{{ item.name }}"
|
dest: "{{ bind9_cfgdir }}/{{ item.name }}"
|
||||||
owner: root
|
owner: root
|
||||||
group: bind
|
group: bind
|
||||||
|
mode: 0640
|
||||||
backup: "{{ item.backup | default('false') | bool }}"
|
backup: "{{ item.backup | default('false') | bool }}"
|
||||||
# validate: 'named-checkconf -z -j %s'
|
# validate: 'named-checkconf -z -j %s'
|
||||||
loop: "{{ bind9_config }}"
|
loop: "{{ bind9_config }}"
|
||||||
@@ -33,8 +34,8 @@
|
|||||||
- bind9
|
- bind9
|
||||||
- template
|
- template
|
||||||
notify:
|
notify:
|
||||||
- backup bind config
|
- Backup bind config
|
||||||
- restart bind
|
- Restart bind
|
||||||
|
|
||||||
- name: Ensure the named service is started
|
- name: Ensure the named service is started
|
||||||
ansible.builtin.service:
|
ansible.builtin.service:
|
||||||
|
|||||||
Reference in New Issue
Block a user