pytest-testinfra
pytest-testinfra copied to clipboard
Not able to retrieve all the nodes-variables list from ansible inventory file using 'all' keyword using get_host method
when i am trying to retrieve the variable list for a specific hostname from a specific ansible inventory using get_host method it works fine like this.
import testinfra test_host1 = testinfra.get_host("ansible://master-r1c1.cluster.local?ansible_inventory=ocp.localhost") print(test_host1.ansible.get_variables())
The ouput is fine
but when i try to give 'all ' keyword instead of 'master-r1c1.cluster.local' it display only the list of host names under each groups in ansible inventory file using get_host() and get_hosts() methods.
I want output similar to this ansible-inventory CLI command
ansible-inventory --inventory ocp.localhost --list