I'm new to SaltStack and ran these two command:
# salt '*' test.echo "$PWD"
# salt '*' cmd.run "pwd"
I have got different output! Does anyone know what is the difference between two above command?
I expected the same result for both commands.
I'm new to SaltStack and ran these two command:
# salt '*' test.echo "$PWD"
# salt '*' cmd.run "pwd"
I have got different output! Does anyone know what is the difference between two above command?
I expected the same result for both commands.
Copyright © 2021 Jogjafile Inc.
When you run a shell command, first any shell expansions are processed, then the command is executed.
For the first command it expands
"$PWD"to the current working directory of the shell, then instructs all minions to run e.g.test.echo('/home/mhm').For the second command it instead instructs all minions to run
cmd.run('pwd'), which returns the current working directory of the minion service.