mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-06 13:22:48 +00:00
win_environment: Added explicit check for null, empty string with state=present (#40468)
* win_environment: Added explicit check for null, empty string with state=present * Added changelog fragment
This commit is contained in:
@@ -9,6 +9,23 @@
|
||||
- process
|
||||
- user
|
||||
|
||||
- name: fail to create environment value with null value
|
||||
win_environment:
|
||||
name: "{{test_environment_name}}"
|
||||
state: present
|
||||
level: machine
|
||||
register: create_fail_null
|
||||
failed_when: create_fail_null.msg != "When state=present, value must be defined and not an empty string, if you wish to remove the envvar, set state=absent"
|
||||
|
||||
- name: fail to create environment value with empty value
|
||||
win_environment:
|
||||
name: "{{test_environment_name}}"
|
||||
value: ''
|
||||
state: present
|
||||
level: machine
|
||||
register: create_fail_empty_string
|
||||
failed_when: create_fail_null.msg != "When state=present, value must be defined and not an empty string, if you wish to remove the envvar, set state=absent"
|
||||
|
||||
- name: create test environment value for machine check
|
||||
win_environment:
|
||||
name: "{{test_environment_name}}"
|
||||
|
||||
Reference in New Issue
Block a user