mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-06-27 10:40:22 -07:00
git_config: fix state=absent if value is present (#8452)
* Fix state=absent if value is present. * Update changelog fragment.
This commit is contained in:
parent
0129346eda
commit
2a3819a696
3 changed files with 27 additions and 1 deletions
|
@ -18,6 +18,30 @@
|
|||
scope: "{{ option_scope }}"
|
||||
register: get_result
|
||||
|
||||
- name: assert unset changed and deleted value
|
||||
assert:
|
||||
that:
|
||||
- unset_result is changed
|
||||
- unset_result.diff.before == option_value + "\n"
|
||||
- unset_result.diff.after == "\n"
|
||||
- get_result.config_value == ''
|
||||
|
||||
- import_tasks: setup_value.yml
|
||||
|
||||
- name: unsetting value with value specified
|
||||
git_config:
|
||||
name: "{{ option_name }}"
|
||||
scope: "{{ option_scope }}"
|
||||
value: "{{ option_value }}"
|
||||
state: absent
|
||||
register: unset_result
|
||||
|
||||
- name: getting value
|
||||
git_config:
|
||||
name: "{{ option_name }}"
|
||||
scope: "{{ option_scope }}"
|
||||
register: get_result
|
||||
|
||||
- name: assert unset changed and deleted value
|
||||
assert:
|
||||
that:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue