-
Notifications
You must be signed in to change notification settings - Fork 354
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: Run Ansible versions validation tasks on check mode #841
Conversation
✅ All required contributors have signed the F5 CLA for this PR. Thank you! |
3c50a6e
to
cab6adb
Compare
I have hereby read the F5 CLA and agree to its terms |
Thanks for the PR! I feel like we should probably leave both the entire jinja2 and collections checks out of check mode? There's not much to assert in the assert task if we skip the tasks to the get the info we need to make the assertions. |
Mmmm i'm not sure about this. My commit is not to skip the validation tasks, but to run them correctly even in check-mode. Is this not what is best ? Thank you |
cab6adb
to
3c43ff3
Compare
You are absolutely right! I glanced over the PR first thing in the morning before I caffeinated myself and I totally misread the text. One last thing, can you update the changelog? |
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]>
3c43ff3
to
08f9969
Compare
Haha no problem, I know the feeling.
Done, I hope that's OK :) |
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:
defaults/main/*.yml
,README.md
andCHANGELOG.md
).