From e0fb55cdf837eb0e42aea512f521e4d6e06a2856 Mon Sep 17 00:00:00 2001 From: Roberto Alfieri Date: Wed, 11 Oct 2023 16:55:23 +0200 Subject: [PATCH] Make `env_data` role compliant with ansible-lint `production` profile - Fixed indentation issues - Added `changed_when`/`failed_when` in `command` task Signed-off-by: Roberto Alfieri --- roles/env_data/meta/argument_specs.yml | 4 ++-- roles/env_data/tasks/main.yml | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/roles/env_data/meta/argument_specs.yml b/roles/env_data/meta/argument_specs.yml index a070d861e..038c3d6bb 100644 --- a/roles/env_data/meta/argument_specs.yml +++ b/roles/env_data/meta/argument_specs.yml @@ -4,6 +4,6 @@ argument_specs: main: short_description: The main entry point for the osp.edpm.env_data role. description: - - Role gathers information about local env and prints it as debug. - - No arguments are expected or necessary. + - Role gathers information about local env and prints it as debug. + - No arguments are expected or necessary. options: {} diff --git a/roles/env_data/tasks/main.yml b/roles/env_data/tasks/main.yml index db2b7a92f..8e3e7283c 100644 --- a/roles/env_data/tasks/main.yml +++ b/roles/env_data/tasks/main.yml @@ -21,6 +21,8 @@ - name: Gather repository list ansible.builtin.command: dnf repolist register: repo_list + changed_when: false + failed_when: repo_list.rc != 0 - name: Output installed packages ansible.builtin.debug: