Debian Codegraph @

test/integration/targets/lookup_ini/test_allow_no_value.yml

raw
1 - name: Lookup test
2 hosts: testhost
3 tasks:
4 - name: "Read mysql.ini allow_none=False (default)"
5 set_fact:
6 test1: "{{ lookup('ini', 'user', file='mysql.ini', section='mysqld') }}"
7 register: result
8 ignore_errors: true
9
10 - name: "Read mysql.ini allow_no_value=True"
11 set_fact:
12 test2: "{{ lookup('ini', 'user', file='mysql.ini', section='mysqld', allow_no_value=True) }}"
13
14 - name: "Read mysql.ini allow_none=True"
15 set_fact:
16 test3: "{{ lookup('ini', 'skip-innodb', file='mysql.ini', section='mysqld', allow_none=True) }}"
17
18 - assert:
19 that:
20 - result is failed
21 - test2 == 'mysql'
22 - test3 == []
23 - test3|length == 0