Skip to content

Commit 899d89e

Browse files
committed
test: default wrapper should use local connection if local
If the ansible connection is local, make the tests_default_wrapper.yml test use local connection also. Signed-off-by: Rich Megginson <[email protected]>
1 parent 78b35a0 commit 899d89e

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

tests/inventory.yaml.j2

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
11
all:
22
hosts:
33
{{ inventory_hostname }}:
4-
{% for key in ["ansible_all_ipv4_addresses", "ansible_all_ipv6_addresses",
4+
{% if ansible_connection == "local" %}
5+
ansible_connection: local
6+
ansible_host: localhost
7+
{% else %}
8+
{% for key in ["ansible_all_ipv4_addresses", "ansible_all_ipv6_addresses",
59
"ansible_default_ipv4", "ansible_default_ipv6", "ansible_host",
610
"ansible_port", "ansible_ssh_common_args",
711
"ansible_ssh_private_key_file","ansible_user"] %}
8-
{% if key in hostvars[inventory_hostname] %}
12+
{% if key in hostvars[inventory_hostname] %}
913
{{ key }}: {{ hostvars[inventory_hostname][key] }}
10-
{% endif %}
11-
{% endfor %}
14+
{% endif %}
15+
{% endfor %}
16+
{% endif %}

0 commit comments

Comments
 (0)