Debian Codegraph @

test/integration/targets/config/validation.yml

raw
1 - hosts: localhost
2 gather_facts: false
3 tasks:
4 - name: does nothing but an empty assign, should fail only if lookup gets invalid options
5 set_fact: whatever={{ lookup('bogus', 1, test_list=['Dan', 'Manuela']) }}
6
7 - name: now pass invalid option and fail!
8 set_fact: whatever={{ lookup('bogus', 1, test_list=['Dan', 'Manuela', 'Yoko']) }}
9 register: bad_input
10 ignore_errors: true
11
12 - name: ensure it fails as expected
13 assert:
14 that:
15 - bad_input is failed
16 - '"invalid value" in bad_input.msg'
17
18 - name: test config option casting
19 set_fact:
20 direct: "{{ lookup('casting', 1, test_list=[1,2,3], test_int=1, test_bool=True, test_str='lola') }}"
21 from_strings: "{{ lookup('casting', 1, test_list='1,2,3', test_int='1', test_bool='true', test_str='lola') }}"
22 direct_individual: "{{ lookup('casting_individual', 1, test_list=[1,2,3], test_int=1, test_bool=true, test_str='lola') }}"
23 from_strings_individual: "{{ lookup('casting_individual', 1, test_list='1,2,3', test_int='1', test_bool='true', test_str='lola') }}"