win_environment
will remove variables if a value is not specified
#40450
Labels
affects_2.5
This issue/PR affects Ansible v2.5
bug
This issue/PR relates to a bug.
module
This issue/PR relates to a module.
support:community
This issue/PR relates to code supported by the Ansible community.
windows
Windows community
ISSUE TYPE
COMPONENT NAME
win_environment
ANSIBLE VERSION
CONFIGURATION
OS / ENVIRONMENT
SUMMARY
win_environment
will remove variables if a value is not specified.STEPS TO REPRODUCE
Set an environment variable ServerRole in a separate playbook or role. Then run the following code:
EXPECTED RESULTS
I would expect no change as I did not specify a value and did not specify a state of absent.
ACTUAL RESULTS
This will remove the variable.
I now that I can pull this from the win_shell module with something like this:
Then to use it this would look like:
But as demonstrated this is not very elegant.
The text was updated successfully, but these errors were encountered: