diff --git a/tests/inventory.yaml.j2 b/tests/inventory.yaml.j2 index 0ef9a454..c3dffa24 100644 --- a/tests/inventory.yaml.j2 +++ b/tests/inventory.yaml.j2 @@ -1 +1,11 @@ -{{ { 'all': { 'hosts': hostvars } } | to_yaml }} +all: + hosts: + {{ inventory_hostname }}: +{% for key in ["ansible_all_ipv4_addresses", "ansible_all_ipv6_addresses", + "ansible_default_ipv4", "ansible_default_ipv6", "ansible_host", + "ansible_port", "ansible_ssh_common_args", + "ansible_ssh_private_key_file","ansible_user"] %} +{% if key in hostvars[inventory_hostname] %} + {{ key }}: {{ hostvars[inventory_hostname][key] }} +{% endif %} +{% endfor %} diff --git a/tests/tests_ssh_wrapper.yml b/tests/tests_ssh_wrapper.yml index 15cc37f8..494b1400 100644 --- a/tests/tests_ssh_wrapper.yml +++ b/tests/tests_ssh_wrapper.yml @@ -33,7 +33,7 @@ tasks: - name: Run ansible-playbook with tests_ssh.yml in check mode command: | - ansible-playbook -vvv -i {{ tempinventory.path }} --check tests_ssh.yml + ansible-playbook -b -vv -i {{ tempinventory.path }} --check tests_ssh.yml delegate_to: localhost changed_when: false