You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ansible/test/integration/targets/lookup_ini/test_case_sensitive.yml

32 lines
1.5 KiB
YAML

- name: Test case sensitive option
hosts: all
tasks:
- name: Lookup a file with keys that differ only in case with case sensitivity enabled
debug:
msg: "{{ lookup('ini', 'name', file='duplicate_case_check.ini', section='reggae', case_sensitive=True) }}"
register: duplicate_case_sensitive_name
- name: Lookup a file with keys that differ only in case with case sensitivity enabled
debug:
msg: "{{ lookup('ini', 'NAME', file='duplicate_case_check.ini', section='reggae', case_sensitive=True) }}"
register: duplicate_case_sensitive_NAME
- name: Lookup a properties file with keys that differ only in case with case sensitivity enabled
debug:
msg: "{{ lookup('ini', 'name', file='lookup_case_check.properties', type='properties', case_sensitive=True) }}"
register: duplicate_case_sensitive_properties_name
- name: Lookup a properties file with keys that differ only in case with case sensitivity enabled
debug:
msg: "{{ lookup('ini', 'NAME', file='lookup_case_check.properties', type='properties', case_sensitive=True) }}"
register: duplicate_case_sensitive_properties_NAME
- name: Ensure the correct case-sensitive values were retrieved
assert:
that:
- duplicate_case_sensitive_name.msg == 'bob'
- duplicate_case_sensitive_NAME.msg == 'marley'
- duplicate_case_sensitive_properties_name.msg == 'captain'
- duplicate_case_sensitive_properties_NAME.msg == 'fantastic'