New in version 2.3.
parameter | required | default | choices | comments |
---|---|---|---|---|
elements | yes | A single path element, or a list of path elements (ie, directories) to add or remove. When multiple elements are included in the list (and state is present ), the elements are guaranteed to appear in the same relative order in the resultant path value.Variable expansions (eg, %VARNAME% ) are allowed, and are stored unexpanded in the target path element.Any existing path elements not mentioned in elements are always preserved in their current order.New path elements are appended to the path, and existing path elements may be moved closer to the end to satisfy the requested ordering. Paths are compared in a case-insensitive fashion, and trailing backslashes are ignored for comparison purposes. However, note that trailing backslashes in YAML require quotes. | ||
name | no | PATH | Target path environment variable name | |
scope | no | machine |
| The level at which the environment variable specified by name should be managed (either for the current user or global machine scope). |
state | no |
| Whether the path elements specified in elements should be present or absent. |
- name: Ensure that system32 and Powershell are present on the global system path, and in the specified order win_path: elements: - '%SystemRoot%\system32' - '%SystemRoot%\system32\WindowsPowerShell\v1.0' - name: Ensure that C:\Program Files\MyJavaThing is not on the current user's CLASSPATH win_path: name: CLASSPATH elements: C:\Program Files\MyJavaThing scope: user state: absent
Note
This module is flagged as preview which means that it is not guaranteed to have a backwards compatible interface.
For more information about Red Hat’s this support of this module, please refer to this knowledge base article<https://access.redhat.com/articles/rhel-top-support-policies>
For help in developing on modules, should you be so inclined, please read Community Information & Contributing, Testing Ansible and Developing Modules.
© 2012–2017 Michael DeHaan
© 2017 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/ansible/latest/win_path_module.html