fix: add linter
Some checks reported errors
continuous-integration/drone/push Build was killed

This commit is contained in:
Markus Pesch 2023-02-08 17:56:13 +01:00
parent b7cba859e2
commit 6b8b178405
Signed by: volker.raschek
GPG Key ID: 852BCC170D81A982
7 changed files with 36 additions and 19 deletions

17
.yamllint.yaml Normal file
View File

@ -0,0 +1,17 @@
#
# Documentation:
# https://yamllint.readthedocs.io/en/stable/
#
rules:
brackets:
forbid: false
min-spaces-inside: 0
max-spaces-inside: 2
min-spaces-inside-empty: 0
max-spaces-inside-empty: 0
indentation:
spaces: 2
indent-sequences: false
line-length:
max: 360

View File

@ -12,7 +12,7 @@ bind9_logging:
- "security_file" - "security_file"
channels: channels:
- name: "security_file" - name: "security_file"
file: ansible.builtin.file:
path: "/var/log/named/security.log" path: "/var/log/named/security.log"
options: "versions 3 size 30m" options: "versions 3 size 30m"
severity: "dynamic" severity: "dynamic"
@ -91,7 +91,7 @@ bind9_views: []
# file: zones/external/db.local.example # file: zones/external/db.local.example
# origin: "example.local." # origin: "example.local."
# type: master # type: master
# notify: yes # notify: true
# - name: internal # - name: internal
# match_clients: # match_clients:
# - "!192.168.178.1" # - "!192.168.178.1"

View File

@ -1,7 +1,7 @@
--- ---
- name: restart named - name: restart named
systemd: ansible.builtin.systemd:
name: "{{ bind_service_name }}" name: "{{ bind_service_name }}"
state: restarted state: restarted
daemon_reload: true daemon_reload: true

View File

@ -4,39 +4,39 @@
include_vars: "{{ ansible_os_family }}.yml" include_vars: "{{ ansible_os_family }}.yml"
- name: Install bind and dependencies - name: Install bind and dependencies
package: ansible.builtin.package:
name: "{{ item }}" name: "{{ item }}"
state: present state: present
with_items: "{{ bind_package_names }}" with_items: "{{ bind_package_names }}"
- name: Create logging directory - name: Create logging directory
file: ansible.builtin.file:
path: "{{ bind_log_directory }}" path: "{{ bind_log_directory }}"
owner: "{{ bind_unix_user }}" owner: "{{ bind_unix_user }}"
group: "{{ bind_unix_group }}" group: "{{ bind_unix_group }}"
mode: 0755 mode: 0755
state: directory state: directory
recurse: yes recurse: true
- name: Create config directory - name: Create config directory
file: ansible.builtin.file:
path: "{{ bind_config_directory }}" path: "{{ bind_config_directory }}"
owner: "{{ bind_unix_user }}" owner: "{{ bind_unix_user }}"
group: "{{ bind_unix_group }}" group: "{{ bind_unix_group }}"
mode: 0755 mode: 0755
state: directory state: directory
recurse: yes recurse: true
- name: Remove existing journal files - name: Remove existing journal files
block: block:
- name: find existing journal files - name: find existing journal files
find: find:
path: "{{ bind_config_directory }}" path: "{{ bind_config_directory }}"
recurse: yes recurse: true
patterns: "*.jnl" patterns: "*.jnl"
register: files_to_delete register: files_to_delete
- name: delete existing journal files - name: delete existing journal files
file: ansible.builtin.file:
path: "{{ item.path }}" path: "{{ item.path }}"
state: absent state: absent
with_items: "{{ files_to_delete.files }}" with_items: "{{ files_to_delete.files }}"
@ -57,7 +57,7 @@
loop_var: view loop_var: view
- name: Create main configuration file - name: Create main configuration file
template: ansible.builtin.template:
src: "etc/named.conf.j2" src: "etc/named.conf.j2"
dest: "{{ bind_main_config }}" dest: "{{ bind_main_config }}"
owner: "{{ bind_unix_user }}" owner: "{{ bind_unix_user }}"
@ -66,7 +66,7 @@
notify: restart named notify: restart named
- name: Create excluded configuration files - name: Create excluded configuration files
template: ansible.builtin.template:
src: "{{ item }}.j2" src: "{{ item }}.j2"
dest: "{{ item | replace('etc/named', bind_config_directory) }}" dest: "{{ item | replace('etc/named', bind_config_directory) }}"
owner: "{{ bind_unix_user }}" owner: "{{ bind_unix_user }}"
@ -82,7 +82,7 @@
notify: restart named notify: restart named
- name: Start and enabled named - name: Start and enabled named
systemd: ansible.builtin.systemd:
name: named name: named
state: started state: started
enabled: yes enabled: true

View File

@ -1,7 +1,7 @@
--- ---
- name: create directory for zone {{ zone.file | dirname }} - name: create directory for zone {{ zone.file | dirname }}
file: ansible.builtin.file:
path: "{{ bind_config_directory }}/{{ zone.file | dirname }}" path: "{{ bind_config_directory }}/{{ zone.file | dirname }}"
owner: "{{ bind_unix_user }}" owner: "{{ bind_unix_user }}"
group: "{{ bind_unix_group }}" group: "{{ bind_unix_group }}"
@ -14,7 +14,7 @@
when: zone.file is defined and zone.file | length > 0 when: zone.file is defined and zone.file | length > 0
- name: "template view {{ view.name }}" - name: "template view {{ view.name }}"
template: ansible.builtin.template:
src: "{{ inventory_hostname }}/etc/named/{{ zone.file }}.j2" src: "{{ inventory_hostname }}/etc/named/{{ zone.file }}.j2"
dest: "{{ bind_config_directory }}/{{ zone.file }}" dest: "{{ bind_config_directory }}/{{ zone.file }}"
owner: "{{ bind_unix_user }}" owner: "{{ bind_unix_user }}"
@ -25,4 +25,4 @@
loop_control: loop_control:
loop_var: zone loop_var: zone
when: zone.type == 'master' when: zone.type == 'master'
notify: restart named notify: restart named

View File

@ -10,4 +10,4 @@ bind_package_names:
bind_service_name: named bind_service_name: named
bind_unix_user: bind bind_unix_user: bind
bind_unix_group: bind bind_unix_group: bind

View File

@ -11,4 +11,4 @@ bind_package_names:
bind_service_name: named bind_service_name: named
bind_unix_user: named bind_unix_user: named
bind_unix_group: named bind_unix_group: named