Debian Codegraph @

test/integration/targets/collections/inventory_test.yml

raw
1 - name: test a collection-hosted connection plugin against hosts from collection-hosted inventory plugins
2 hosts: dynamic_host_a, dynamic_host_redirected
3 gather_facts: no
4 vars:
5 ansible_connection: testns.testcoll.localconn
6 ansible_localconn_connectionvar: from_play
7 tasks:
8 - raw: echo 'hello world'
9 register: connection_out
10
11 - assert:
12 that:
13 - connection_out.stdout == "localconn ran echo 'hello world'"
14 # ensure that the connection var we overrode above made it into the running config
15 - connection_out.stderr == "connectionvar is from_play"
16
17
18 - hosts: localhost
19 gather_facts: no
20 tasks:
21 - assert:
22 that:
23 - hostvars['dynamic_host_a'] is defined
24 - hostvars['dynamic_host_a'].connection_out.stdout == "localconn ran echo 'hello world'"
25 - hostvars['dynamic_host_redirected'] is defined
26 - hostvars['dynamic_host_redirected'].connection_out.stdout == "localconn ran echo 'hello world'"