Hi,
I could not find how to really use cmd.script in a state. I followed the docs and are using cmd.run in production with success, but my state file outputs some weird stuff if I run my cmd.script:
minion1:
----------
State: - cmd
Name: upgrade-to-php5.4
Function: script
Result: True
Comment: Command "upgrade-to-php5.4" run
Changes: pid: 6927
retcode: 0
stderr: stdin: is not a tty
stdout:
Here is excerpt from my state file:
...
upgrade-to-php5.4:
cmd.script:
- user: root
- shell: /bin/bash
- source: salt://language/php54/prepare-for-php54.sh
...
My shell script is writing into to a tmp-file for testing but it is somehow not executed by the state engine. Interestingly, if I run the same stuff via
salt '*' salt://language/php54/prepare-for-php54.sh
then Salt complains that the file is not existing!? But it is existing and the path normally works with other files, too. Does anyone use cmd.script and can maybe give a real-world example? Thank you so much!