From cab6adb2dfd5a4e9bded3f6f8f851cc31164ed2a Mon Sep 17 00:00:00 2001 From: Alexis Thietard Date: Thu, 19 Dec 2024 09:34:03 +0100 Subject: [PATCH] fix: ansible versions validation tasks fix #840 Since a6712e391ab1a283cf24102a4055ea16fc756105, ansible and jinja versions are validated to ensure supported versions are used. This validation is done by delegating `command` tasks to localhost, and parsing the standard output of the executed commands, e.g. `ansible --version`. The `ansible.builtin.command` module is not run when in check mode, causing the variable which is supposed to get the result of the command to be empty, resulting in an error message in the following tasks that parse these result variables. This commit ensures the `command` tasks are run even in check_mode. As they do no modification on localhost, this is not dangerous. Signed-off-by: Alexis Thietard --- tasks/validate/validate.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tasks/validate/validate.yml b/tasks/validate/validate.yml index 35b4b1d4b..7605aa0ef 100644 --- a/tasks/validate/validate.yml +++ b/tasks/validate/validate.yml @@ -15,6 +15,7 @@ changed_when: false delegate_to: localhost become: false + check_mode: false - name: Verify that you are using a supported Jinja2 version on your Ansible host ansible.builtin.assert: @@ -30,6 +31,7 @@ changed_when: false delegate_to: localhost become: false + check_mode: false - name: Verify that the 'community.general' Ansible collection is installed on your Ansible host ansible.builtin.assert: