From 28f8ca5c12e45ac07d3d966469d72bd5e3fc60ad Mon Sep 17 00:00:00 2001 From: Daniel Akulenok Date: Wed, 28 Jan 2026 23:20:56 +0100 Subject: [PATCH] fix: resolve ansible-lint errors - 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 --- .gitea/workflows/test.yaml | 2 +- handlers/main.yml | 2 +- molecule/default/prepare.yml | 3 ++- tasks/main.yml | 14 ++++++++------ 4 files changed, 12 insertions(+), 9 deletions(-) diff --git a/.gitea/workflows/test.yaml b/.gitea/workflows/test.yaml index 3e707ad..ade6569 100644 --- a/.gitea/workflows/test.yaml +++ b/.gitea/workflows/test.yaml @@ -1,7 +1,7 @@ --- name: Test -on: +'on': push: branches: - main diff --git a/handlers/main.yml b/handlers/main.yml index f37a250..26a4665 100644 --- a/handlers/main.yml +++ b/handlers/main.yml @@ -21,5 +21,5 @@ ansible_facts.date_time.iso8601_basic_short + '.tar.gz' }}" owner: root group: root - mode: 0640 + mode: '0640' when: bind9_backup_config is defined and bind9_backup_config diff --git a/molecule/default/prepare.yml b/molecule/default/prepare.yml index 1e2104d..a85e9f5 100644 --- a/molecule/default/prepare.yml +++ b/molecule/default/prepare.yml @@ -1,5 +1,6 @@ --- -- hosts: all +- name: Prepare + hosts: all tasks: - name: Update apt ansible.builtin.apt: diff --git a/tasks/main.yml b/tasks/main.yml index 9e696e8..e88e1de 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -15,10 +15,13 @@ state: directory owner: root group: root - mode: 0750 + mode: '0750' when: bind9_backup_config is defined and bind9_backup_config | bool - name: Deploy and Validate Configuration + tags: + - bind9 + - template block: - name: Create backup of current config ansible.builtin.copy: @@ -27,9 +30,8 @@ remote_src: true owner: root group: bind - mode: 0640 - failed_when: false # It's okay if the file doesn't exist yet - # We do this for every file in the loop + mode: '0640' + failed_when: false # It's okay if the file doesn't exist yet loop: "{{ bind9_config }}" loop_control: label: "{{ item.name }}" @@ -40,7 +42,7 @@ dest: "{{ bind9_cfgdir }}/{{ item.name }}" owner: root group: bind - mode: 0640 + mode: '0640' loop: "{{ bind9_config }}" loop_control: label: "{{ item.name }}" @@ -59,7 +61,7 @@ remote_src: true owner: root group: bind - mode: 0640 + mode: '0640' loop: "{{ bind9_config }}" loop_control: label: "{{ item.name }}"