.. _shell: shell `````````````````````````````` .. versionadded:: 0.2 The shell module takes the command name followed by a list of arguments, space delimited. It is almost exactly like the ``command`` module but runs the command through the user's configured shell on the remote node. .. raw:: html
parameter | required | default | choices | comments |
---|---|---|---|---|
creates | no | a filename, when it already exists, this step will NOT be run | ||
chdir | no | cd into this directory before running the command (0.6 and later) | ||
(free form) | no | The command module takes a free form command to run |
Execute the command in remote shell
shell somescript.sh >> somelog.txt
If you want to execute a command securely and predicably, it may be better to use the command module instead. Best practices when writing playbooks will follow the trend of using command unless shell is explicitly required. When running ad-hoc commands, use your best judgement.