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

If passwords file exists, passing in passwords dictionary to interface.run does not work #517

Closed
clickthisnick opened this issue Sep 9, 2020 · 2 comments

Comments

@clickthisnick
Copy link
Contributor

If there is already a serialized passwords file, then passing passwords into the interface.run fails.

To reproduce, run this twice. On first run it works fine (And serializes the /runner/env/passwords file)
On second run it fails, since that file exists.

import ansible_runner.interface

kwargs = {}
kwargs['playbook'] = 'test.yml'
kwargs['private_data_dir'] = '/runner'
kwargs['passwords'] = {"SSH [pP]assword:": "password"}

stdout = ansible_runner.interface.run(**kwargs)

Error:

Traceback (most recent call last):
  File "runner.py", line 11, in <module>
    stdout = ansible_runner.interface.run(**kwargs)
  File "/opt/ansible/3.6.5/lib64/python3.6/site-packages/ansible_runner/interface.py", line 210, in run
    r = init_runner(**kwargs)
  File "/opt/ansible/3.6.5/lib64/python3.6/site-packages/ansible_runner/interface.py", line 74, in init_runner
    rc = RunnerConfig(**kwargs)
TypeError: __init__() got an unexpected keyword argument 'passwords'

At this point if I rm -rf /runner/env/passwords then run again, it will work.

I'm not sure the expected outcome, but I would have thought passwords would have merged into or overridden the serialized passwords file.

@AlanCoding
Copy link
Member

this is a duplicate of #493

@clickthisnick
Copy link
Contributor Author

Ah, didn't see that, will close. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants