- 1 year ago
Saltstack - win_path doesn't modify system PATH variable as expected
There could be several reasons why the win_path
module in Saltstack is not modifying the system PATH variable as expected. Here are some possible solutions:
Check if the minion has the necessary permissions to modify the system PATH variable. The minion should be running with administrative privileges.
Verify that the
win_path
module is installed and available on the minion. You can check this by running the following command on the minion:sqlsalt-call --local sys.doc win_path
If the module is not available, you can install it using the following command:
sqlsalt-call --local pkg.install salt.modules.win_path
Ensure that the
append_to_path
parameter is set toTrue
in your state file or command.yaml- name: Add to path
win_path.append:
- dir_name: C:\MyApp
- append_to_path: True
Verify that the
set_path
parameter is set toTrue
. If this parameter is not set, the module will not modify the system PATH variable.yaml- name: Add to path
win_path.append:
- dir_name: C:\MyApp
- set_path: True
Check if there are any other modules or processes that are modifying the system PATH variable. It is possible that another module is overriding the changes made by the
win_path
module.Try running the command or state file again after restarting the Salt minion. This may help to clear any issues related to the module or the environment.
If none of these solutions work, you can try using a different module or tool to modify the system PATH variable.