mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-22 21:00:22 -07:00
* Bugfix: Fix parsing array values in osx_defaults
Unquote values and unescape double quotes when reading array values from defaults.
* Fix fragments: fix_parsing_array_values_in_osx_defaults
Co-authored-by: Felix Fontein <felix@fontein.de>
* add test code for Bugfix: Fix parsing array values from osx_defaults
* handle spaces after the comma
Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit 1110e93c5d
)
Co-authored-by: Kazufumi NOTO <noto.kazufumi@gmail.com>
This commit is contained in:
parent
fb3085e78d
commit
d2b1df49c1
3 changed files with 47 additions and 2 deletions
|
@ -208,3 +208,46 @@
|
|||
- assert:
|
||||
that: "{{ item.changed }}"
|
||||
with_items: "{{ test_data_types.results }}"
|
||||
|
||||
|
||||
- name: Ensure test key does not exist
|
||||
osx_defaults:
|
||||
domain: com.ansible.fake_array_value
|
||||
key: ExampleArrayKey
|
||||
state: absent
|
||||
|
||||
- name: add array value for the first time
|
||||
osx_defaults:
|
||||
domain: com.ansible.fake_array_value
|
||||
key: ExampleArrayKey
|
||||
value:
|
||||
- 'Value with spaces'
|
||||
type: array
|
||||
array_add: yes
|
||||
register: test_array_add
|
||||
|
||||
- assert:
|
||||
that: test_array_add.changed
|
||||
|
||||
- name: add for the second time, should be skipped
|
||||
osx_defaults:
|
||||
domain: com.ansible.fake_array_value
|
||||
key: ExampleArrayKey
|
||||
value:
|
||||
- 'Value with spaces'
|
||||
type: array
|
||||
array_add: yes
|
||||
register: test_array_add
|
||||
|
||||
- assert:
|
||||
that: not test_array_add.changed
|
||||
|
||||
- name: Clean up test key
|
||||
osx_defaults:
|
||||
domain: com.ansible.fake_array_value
|
||||
key: ExampleArrayKey
|
||||
state: absent
|
||||
register: test_array_add
|
||||
|
||||
- assert:
|
||||
that: test_array_add.changed
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue