From 020c785bbbfcfbc03b603fb1aaa3a34358d217a0 Mon Sep 17 00:00:00 2001 From: L3D Date: Sat, 28 Oct 2023 18:12:24 +0200 Subject: [PATCH] Update linting --- .github/workflows/ansible-linting-check.yml | 4 ++-- .github/workflows/j2lint-check.yml | 4 ++-- .github/workflows/yamllint-check.yml | 2 +- tasks/avahi_services.yml | 4 ++-- tasks/main.yml | 12 ++++++++---- tasks/versioncheck.yml | 5 ++--- vars/main.yml | 2 +- 7 files changed, 18 insertions(+), 15 deletions(-) diff --git a/.github/workflows/ansible-linting-check.yml b/.github/workflows/ansible-linting-check.yml index 0996001..1a76d38 100644 --- a/.github/workflows/ansible-linting-check.yml +++ b/.github/workflows/ansible-linting-check.yml @@ -10,8 +10,8 @@ jobs: runs-on: ubuntu-latest steps: - - name: 'Checkout git repo' - uses: actions/checkout@v4.1.1 + - name: Checkout git repo + uses: actions/checkout@v4 with: submodules: true fetch-depth: 0 diff --git a/.github/workflows/j2lint-check.yml b/.github/workflows/j2lint-check.yml index 3f74620..00c7861 100644 --- a/.github/workflows/j2lint-check.yml +++ b/.github/workflows/j2lint-check.yml @@ -10,8 +10,8 @@ jobs: runs-on: ubuntu-latest steps: - - name: 'Checkout git repo' - uses: actions/checkout@v4.1.1 + - name: Checkout git repo + uses: actions/checkout@v4 with: submodules: true fetch-depth: 0 diff --git a/.github/workflows/yamllint-check.yml b/.github/workflows/yamllint-check.yml index 48d9af2..5e62f57 100644 --- a/.github/workflows/yamllint-check.yml +++ b/.github/workflows/yamllint-check.yml @@ -10,7 +10,7 @@ jobs: runs-on: ubuntu-latest steps: - - name: 'Checkout git repo' + - name: Checkout git repo uses: actions/checkout@v4 with: submodules: true diff --git a/tasks/avahi_services.yml b/tasks/avahi_services.yml index 04bea8f..a893a18 100644 --- a/tasks/avahi_services.yml +++ b/tasks/avahi_services.yml @@ -7,7 +7,7 @@ mode: '0755' state: directory path: "{{ item }}" - with_items: + loop: - '/etc/avahi' - '/etc/avahi/services' notify: @@ -21,6 +21,6 @@ owner: root group: root mode: 'u=rw,g=r,o=r' + loop: "{{ avahi_daemon__services }}" notify: - Run systemctl restart avahi-daemon.service - with_items: "{{ avahi_daemon__services }}" diff --git a/tasks/main.yml b/tasks/main.yml index 93bffa2..537a0ce 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -1,16 +1,20 @@ --- - name: Run optional versionscheck - ansible.builtin.include_tasks: versioncheck.yml + ansible.builtin.include_tasks: + file: versioncheck.yml when: submodules_versioncheck | bool - name: Gather os specific variables - ansible.builtin.include_vars: "{{ item }}" + ansible.builtin.include_vars: + file: "{{ item }}" with_first_found: - "vars/{{ ansible_os_family }}.yml" - "vars/os_fallback.yml" - name: Install avahi requirements - ansible.builtin.include_tasks: install.yml + ansible.builtin.include_tasks: + file: install.yml - name: Optionally announce avahi services - ansible.builtin.include_tasks: avahi_services.yml + ansible.builtin.include_tasks: + file: avahi_services.yml diff --git a/tasks/versioncheck.yml b/tasks/versioncheck.yml index dd22a1a..e660e3e 100644 --- a/tasks/versioncheck.yml +++ b/tasks/versioncheck.yml @@ -16,15 +16,14 @@ src: "/etc/.ansible-version/{{ playbook_version_path }}" register: playbook_version when: submodules_versioncheck | bool - ignore_errors: true failed_when: false -- name: Print remote role version +- name: Print remote role version # noqa: H500 ansible.builtin.debug: msg: "Remote role version: {{ playbook_version.content | default('Y3VycmVudGx5IG5vdCBkZXBsb3llZAo=') | b64decode | string }}" when: submodules_versioncheck | bool -- name: Print locale role version +- name: Print locale role version # noqa: H500 ansible.builtin.debug: msg: "Local role version: '{{ playbook_version_number | string }}'." when: submodules_versioncheck | bool diff --git a/vars/main.yml b/vars/main.yml index f020892..1947a29 100644 --- a/vars/main.yml +++ b/vars/main.yml @@ -1,4 +1,4 @@ --- # versionscheck -playbook_version_number: 9 +playbook_version_number: 10 playbook_version_path: 'do1jlr.avahi_daemon.version'