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

View File

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

View File

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

View File

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