Saltstack
in the
Windows
Client remote execution script prompts for wrong path
Environment:
Salt-master ==2018.3.0
Salt-minion ==2018.3.0
python== 2.7.5
Centos==7
Problem Description:
Salt A module that has a remote execution command Cmd.script , an error occurred while using the module:
Salt ' minion-id ' cmd.script salt://test.ps1 Shell=powershell
which salt:// to be /etc/salt.conf defined by Base path, which was stored under the Test.ps1 the Script
# Vim Test.ps1
echo Test
Return error message:
View Windows Client Logs c:\salt\var\log\salt\minion :
Viewing the catalog does Minion has been removed from Master Download to window Temp directory and random rename
after the investigation, the department because2018.3.0versionSalthave aBug, theBugis to convert the executed script into apythonthe listList, and then re-convert back to stringstringtype with a single quote "'", butWindowsthe script name path format with single quotation marks is not recognized, causing problems, which are visiblepythonsource code.
actually from 2017.4 version is available, 2017.7 version is fixed, but because another version of the branch is opened, 2018.3.0 did not fix the Bug , only 2018.3.1 was repaired.
https://github.com/saltstack/salt/pull/45716
https://github.com/saltstack/salt/pull/45716
Workaround:
Upgrade Salt-master to the 2018.3.1 version, upgrade salt-minion to the 2018.3.1 version and Master remain consistent.
Successfully re-executing the command and getting the results returned:
Experience:
when selecting the version of the tool, you should pay more attention to the release note on the official website , choose a more normal and stable version to avoid the subsequent encounter more wonderful problems.
in the question or help asker solve the problem, also pay attention to check version information, otherwise there will always be some situation: why I clearly follow correct solution to do is not?!
In the process of solving, unconsciously can grasp a lot of things.
Multi-crossing network and community, no one in China can answer.
Saltstack the wrong path to the remote script prompt in Windows client