8000 Prevent Ansible args from leaking to create and destroy by tadeboro · Pull Request #2966 · ansible/molecule · GitHub
[go: up one dir, main page]

Skip to content

Prevent Ansible args from leaking to create and destroy - #2966

Merged
ssbarnea merged 1 commit into
ansible:masterfrom
xlab-steampunk:fix-2963
Nov 17, 2020
Merged

ssbarnea merged 1 commit into
ansible:masterfrom
xlab-steampunk:fix-2963

Conversation

@tadeboro
@tadeboro tadeboro commented Nov 15, 2020 •
Copy link
Copy Markdown
Contributor

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
Copy Markdown
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
Copy Markdown
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

0