Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: ansible versions validation tasks #841

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Al-thi
Copy link

@Al-thi Al-thi commented Dec 19, 2024

Proposed changes

fix #840

Since a6712e3, 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.

Checklist

Before creating a PR, run through this checklist and mark each as complete:

@Al-thi Al-thi requested a review from alessfg as a code owner December 19, 2024 08:44
Copy link

github-actions bot commented Dec 19, 2024

✅ All required contributors have signed the F5 CLA for this PR. Thank you!
Posted by the CLA Assistant Lite bot.

@github-actions github-actions bot added the bug Something isn't working label Dec 19, 2024
fix nginxinc#840

Since a6712e3, 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 <[email protected]>
@Al-thi Al-thi force-pushed the fix/versions-validation branch from 3c50a6e to cab6adb Compare December 19, 2024 08:45
@Al-thi
Copy link
Author

Al-thi commented Dec 19, 2024

I have hereby read the F5 CLA and agree to its terms

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Check mode is broken by ansible version validation
1 participant