<p>If you only want to run a command if a certain file does not exist, you can do the
<p>creates and chdir can be specified after the command. For instance, if you only want to run a command if a certain file does not exist, you can do the following:</p>
The given command will be executed on all selected nodes. It will not
The given command will be executed on all selected nodes. It will not
be processed through the shell, so variables like "$HOME" and
be processed through the shell, so variables like "$HOME" and
operations like "<", ">", "|", and "&" will not work. As such, all
operations like "<", ">", "|", and "&" will not work. As such, all
paths to commands must be fully qualified.
paths to commands must be fully qualified.
This module does not support change hooks and returns the return code
NOTE:: If you want to run a command through the shell (say you are using
from the program as well as timing information about how long the
'<', '>', '|', etc), you actually want the 'shell' module instead.
command was running.
The 'command' module is much more secure as it's not affected by the user's environment.
Example action from Ansible :doc:`playbooks`::
Example action from Ansible :doc:`playbooks`::
command /sbin/shutdown -t now
command /sbin/shutdown -t now
If you only want to run a command if a certain file does not exist, you can do the
creates and chdir can be specified after the command. For instance, if you only want to run a command if a certain file does not exist, you can do the following::