Open mrdima opened 5 years ago
I think testinfra should take in account ansible_ssh_common_args
and jumphost
from inventory.
Or maybe have a way to disable direct connection with testinfra ssh backend and connect directly with ansible (this is slower because it rely on a subprocess call to ansible, but all ansible connections options will work).
I think both options would be cool, eg a parameter to use either ansible or direct. Via ansible is currently really slow indeed, so direct connection would be great, but indeed the args should be taken into account then.
Version 3.0 (all from .0.0 to .0.5) breaks connections to ansible hosts behind a "jumphost or bastionhost". (#439 Doesn't fix it) What worked fine in 2.x version now doesn't. For some reason testinfra wants to lookup host dns names locally, but that is in our case impossible. They can only be resolved when using the jumphost.
Consider the following inventory:
Which basically says (using the common_args) that it needs to reach everything using the jumphost ssh running on port 12345 Then running:
py.test --color=yes -n 3 -vv --hosts='ansible://nodes' --ansible-inventory /inventory -p no:cacheprovider
Results in:
As stated, this works fine in testinfra 2.x. How can we get this to work with 3.x?
Thanks!