Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions tests/inventory.yaml.j2
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
all:
hosts:
{{ inventory_hostname }}:
{% for key in ["ansible_all_ipv4_addresses", "ansible_all_ipv6_addresses",
{% if __ansible_connection == "local" %}
ansible_connection: local
ansible_host: localhost
{% else %}
{% 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] %}
{% if key in hostvars[inventory_hostname] %}
{{ key }}: {{ hostvars[inventory_hostname][key] }}
{% endif %}
{% endfor %}
{% endif %}
{% endfor %}
{% endif %}
4 changes: 4 additions & 0 deletions tests/tests_default_wrapper.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
tags:
- 'tests::slow'
tasks:
- name: Save connection method
set_fact:
__ansible_connection: "{{ ansible_connection }}"

- name: Create temporary file
tempfile:
state: file
Expand Down
5 changes: 4 additions & 1 deletion tests/tests_ssh_wrapper.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
tags:
- 'tests::slow'
tasks:
- name: Save connection method
set_fact:
__ansible_connection: "{{ ansible_connection }}"

- name: Create temporary file
tempfile:
state: file
Expand All @@ -18,7 +22,6 @@
mode: "0644"
delegate_to: localhost


- name: Run tests_ssh.yml normally
tags:
- 'tests::slow'
Expand Down
Loading