New in version 2.0.
The level at which to set the environment variable.
Use 'machine' to set for all users.
Use 'user' to set for the current user that ansible is connected as.
Use 'process' to set for the current process. Probably not that useful.
The name of the environment variable
present to ensure environment variable is set, or absent to ensure it is removed
The value to store in the environment variable. Can be omitted for state=absent
- name: Set an environment variable for all users win_environment: state: present name: TestVariable value: Test value level: machine - name: Remove an environment variable for the current user win_environment: state: absent name: TestVariable level: user
Common return values are documented here Return Values, the following are the fields unique to this module:
the value of the environment key before a change, this is null if it didn't exist
the name of the environment key the module checked
the value the environment key has been set to
the level set when calling the module