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

Prevent Ansible args from leaking to create and destroy #2966

Merged
merged 1 commit into from
Nov 17, 2020

Conversation

tadeboro
Copy link
Contributor

@tadeboro tadeboro commented Nov 15, 2020

When we were removing the dependency on the sh Python package from the codebase, we inadvertently changed the behavior of the Ansible arguments that user supplies either on the command line on in the provisioner part of the scenario configuration (commit 1cefe5c).

Changes in this commit restore the previous state when Ansible args were not passed to the create and destroy playbook executions.

Fixes #2963

PR Type

  • Bugfix Pull Request

@ssbarnea ssbarnea added the bug label Nov 17, 2020
@ssbarnea
Copy link
Member

I knew it! I deliberately simplified the code because I did not see why these should not be passed and because it did not break any tests.... so blame me for introducing that bug.

I approved the fix but I will let you decide if you want to merge it like this or if you can also add two bits to it:

  • a small comment before the if explaining why we do not want args for create/destroy - why they are special
  • a test that would fail if someone removes this code (if ansible args do slip in, again)

@tadeboro
Copy link
Contributor Author

* a small comment before the if explaining why we do not want args for create/destroy - why they are special

I will add this comment to the code.

* a test that would fail if someone removes this code (if ansible args do slip in, again)

The test is already there (https://github.com/ansible-community/molecule/blob/94624bcd5f119f5553b7ab0edd3855307bae01f4/lib/molecule/test/unit/provisioner/test_ansible_playbook.py#L109), but it failed to detect the change because we updated it by mistake. I already fixed the test, so we should be safe in the future (until we mess up the tests again, that is ;)).

When we were removing the dependency on the sh Python package from the
codebase, we inadvertently changed the behavior of the Ansible
arguments that user supplies either on the command line on in the
provisioner part of the scenario configuration (commit
1cefe5c).

Changes in this commit restore the previous state when Ansible args
were not passed to the create and destroy playbook executions.

Signed-off-by: Tadej Borovšak <tadej.borovsak@xlab.si>
@ssbarnea ssbarnea merged commit bad8cee into ansible:master Nov 17, 2020
@tadeboro tadeboro deleted the fix-2963 branch November 17, 2020 14:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ansible_args passed to all steps
2 participants