Debian Codegraph @

test/integration/targets/delegate_to/delegate_vars_handling.yml

raw
1 - name: ensure we dont use orig host vars if delegated one does not define them
2 hosts: testhost
3 gather_facts: false
4 connection: local
5 tasks:
6 - name: force current host to use winrm
7 set_fact:
8 ansible_connection: winrm
9
10 - name: this should fail (missing winrm or unreachable)
11 ping:
12 ignore_errors: true
13 ignore_unreachable: true
14 register: orig
15
16 - name: ensure prev failed
17 assert:
18 that:
19 - orig is failed or orig is unreachable
20
21 - name: this will only fail if we take orig host ansible_connection instead of defaults
22 ping:
23 delegate_to: delegatetome
24
25
26 - name: ensure plugin specific vars are properly used
27 hosts: testhost
28 gather_facts: false
29 tasks:
30 - name: set unusable ssh args
31 set_fact:
32 ansible_host: 127.0.0.1
33 ansible_connection: ssh
34 ansible_ssh_port: 9876
35 ansible_connection_timeout: 5
36
37 - name: fail to ping with bad args
38 ping:
39 register: bad_args_ping
40 ignore_unreachable: true
41
42 - debug: var=bad_args_ping
43 - name: ensure prev failed
44 assert:
45 that:
46 - bad_args_ping is failed or bad_args_ping is unreachable
47
48 - name: this should work by ignoring the bad args for orig host
49 ping:
50 delegate_to: delegatetome