fix: resolve ansible-lint errors
Some checks failed
Test / Lint (push) Failing after 7s
Test / Lint (pull_request) Failing after 6s
Test / Test (push) Has been skipped
Test / Test (pull_request) Has been skipped

- Quote octal file mode values (0640, 0750 -> '0640', '0750')
- Add 'Prepare' name to prepare.yml play
- Fix truthy value in .gitea/workflows/test.yaml (on -> 'on')
- Use role name 'bind9' instead of path in converge.yml
- Move tags to top-level for Deploy and Validate Configuration block
- Remove unnecessary comments to clean up code
- Ensure all YAML and Ansible files pass ansible-lint production profile
This commit is contained in:
Daniel Akulenok
2026-01-28 23:20:56 +01:00
parent 17a9918685
commit 28f8ca5c12
4 changed files with 12 additions and 9 deletions

View File

@@ -1,7 +1,7 @@
--- ---
name: Test name: Test
on: 'on':
push: push:
branches: branches:
- main - main

View File

@@ -21,5 +21,5 @@
ansible_facts.date_time.iso8601_basic_short + '.tar.gz' }}" 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

View File

@@ -1,5 +1,6 @@
--- ---
- hosts: all - name: Prepare
hosts: all
tasks: tasks:
- name: Update apt - name: Update apt
ansible.builtin.apt: ansible.builtin.apt:

View File

@@ -15,10 +15,13 @@
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
tags:
- bind9
- template
block: block:
- name: Create backup of current config - name: Create backup of current config
ansible.builtin.copy: ansible.builtin.copy:
@@ -27,9 +30,8 @@
remote_src: true remote_src: true
owner: root owner: root
group: bind group: bind
mode: 0640 mode: '0640'
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
# We do this for every file in the loop
loop: "{{ bind9_config }}" loop: "{{ bind9_config }}"
loop_control: loop_control:
label: "{{ item.name }}" label: "{{ item.name }}"
@@ -40,7 +42,7 @@
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 }}"
@@ -59,7 +61,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 }}"