mirror of https://github.com/ansible/ansible.git
ini lookup - add case sensitive option (#74630)
* Add tests for case-sensitive option * Run all test playbooks from a single filepull/74719/head
parent
2f87b8760d
commit
d8e6f21d9f
@ -0,0 +1,2 @@
|
||||
minor_changes:
|
||||
- ini lookup - add case sensitive option (https://github.com/ansible/ansible/issues/74601)
|
||||
@ -0,0 +1,2 @@
|
||||
name = captain
|
||||
NAME = fantastic
|
||||
@ -0,0 +1,31 @@
|
||||
- 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 retieved
|
||||
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'
|
||||
@ -0,0 +1,3 @@
|
||||
- import_playbook: test_lookup_properties.yml
|
||||
- import_playbook: test_errors.yml
|
||||
- import_playbook: test_case_sensitive.yml
|
||||
Loading…
Reference in New Issue