Open lmesz-bitrise opened 4 years ago
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
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")
as of 2024, issue still reproduced. Ansible deprecates ansible_ssh_pass way long ago, maybe it's time to finally fix it?
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.