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

ansible_runner doesn't accept ansible's user password via ansible_password variable #580

Open
lmesz-bitrise opened this issue Nov 2, 2020 · 2 comments

Comments

@lmesz-bitrise
Copy link

When using testinfra with ansible_runner the only acceptable variable that can contain the password for ansible's user is ansible_ssh_pass. Based on ansible documentation if the user wants to use ansible with a password the ansible_password must be set.
The reason why only ansible_ssh_pass is accepted is that the password parameter is directly pulled from ansible_ssh_pass. See code here
I plan to create a PR to fix this if it is okay.

@urskog84
Copy link

urskog84 commented Aug 20, 2022

Hi @lmesz-bitrise thanks for adding this issue. It took me a long time to find the solution to this. I have always used the ansible_password: variable name for my ansible inventorys..

Some google phrases i used

  • testinfra promts for password
  • testinfra ask for password
  • testinfra ansible promts for password

After looking around in the code, I think that the errors are here
https://github.com/pytest-dev/pytest-testinfra/blob/master/testinfra/utils/ansible_runner.py#L148

Possibel solution to this issue

password = get_config("ansible_ssh_pass")
if password == None:
    password = get_config("ansible_password")

@mshonichev
Copy link

as of 2024, issue still reproduced.
Ansible deprecates ansible_ssh_pass way long ago, maybe it's time to finally fix it?

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

3 participants