win_environment
Manage Windows environment variables
Collection: ansible.windows
Full Name: parallax.windows.win_environment
Aliases: ansible.windows.win_environment, win_environment
Synopsis
Manage Windows environment variables
Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
| level | string | yes | Environment scope: machine, user, or process | |
| name | string | Variable name; mutually exclusive with variables | ||
| state | string | Desired state: present or absent; inferred from value when omitted | ||
| value | string | Variable value | ||
| variables | map[string]any | Variables to set; empty or null values remove variables |
Example
yaml
- name: Set a user environment variable
ansible.windows.win_environment:
level: user
name: EXAMPLE
value: example