From 4410fbcd9a524840b905c783a981afc8d36ce645 Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Mon, 11 Sep 2023 14:51:02 +0200 Subject: fix some ansible-lint warnings --- roles/etckeeper/handlers/commit_conf.yml | 8 ++++---- roles/pacman/tasks/main.yml | 4 ++-- roles/rate_mirrors/tasks/main.yml | 7 ++++--- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/roles/etckeeper/handlers/commit_conf.yml b/roles/etckeeper/handlers/commit_conf.yml index a9eb409..134e264 100644 --- a/roles/etckeeper/handlers/commit_conf.yml +++ b/roles/etckeeper/handlers/commit_conf.yml @@ -7,16 +7,16 @@ | grep -G -v '^etckeeper/etckeeper.conf' args: chdir: /etc - register: etckeeper_modified_files + register: git_status changed_when: false - failed_when: etckeeper_modified_files.rc not in [0, 1] + failed_when: git_status.rc not in [0, 1] - name: Fail if unexpected files were modified ansible.builtin.fail: msg: | Unexpected files were modified: - {{ etckeeper_modified_files.stdout }} - when: etckeeper_modified_files.rc == 0 + {{ git_status.stdout }} + when: git_status.rc == 0 - name: etckeeper commit become: true diff --git a/roles/pacman/tasks/main.yml b/roles/pacman/tasks/main.yml index 213ef01..5ed782f 100644 --- a/roles/pacman/tasks/main.yml +++ b/roles/pacman/tasks/main.yml @@ -23,8 +23,8 @@ when: not etc_versioned - name: Check for changes in /etc - ansible.builtin.command: git status --porcelain=v1 - args: + ansible.builtin.command: # noqa: command-instead-of-module + cmd: git status --porcelain=v1 chdir: /etc register: git_status changed_when: false diff --git a/roles/rate_mirrors/tasks/main.yml b/roles/rate_mirrors/tasks/main.yml index d000b13..9d40fa2 100644 --- a/roles/rate_mirrors/tasks/main.yml +++ b/roles/rate_mirrors/tasks/main.yml @@ -10,13 +10,14 @@ become: true block: - name: Check for changes in /etc - ansible.builtin.command: git status --porcelain=v1 - args: + ansible.builtin.command: # noqa: command-instead-of-module + cmd: git status --porcelain=v1 chdir: /etc register: git_status changed_when: false - - ansible.builtin.fail: + - name: Fail + ansible.builtin.fail: msg: | There are uncommitted changes in /etc: {{ git_status.stdout }} -- cgit v1.2.3