If you have a need for this parameter, use the module instead.įor rebooting systems, use the or _reboot module. The executable parameter is removed since version 2.4. If these are not supplied, the task will be skipped. If running in check mode and either of these are specified, the module will check for the existence of the file and report the correct changed status. For instance, if you only want to run a command if a certain file does not exist, use this.Ĭheck mode is supported when passing creates or removes. Parsing shell metacharacters can lead to unexpected commands being executed if quoting is not done correctly so it is more secure to use the command module when possible.Ĭreates, removes, and chdir can be specified after the command. If you want to run a command through the shell (say you are using, |, and so on), you actually want the module instead. To create command tasks that are easier to read than the ones using space-delimited arguments, pass parameters using the args task keyword or use cmd parameter.Įither a free form command or cmd parameter is required, see the examples.įor Windows targets, use the _command module instead. Use the module if you need these features. The command(s) will not be processed through the shell, so variables like $HOSTNAME and operations like "*", "", "|", " " and "&" will not work. The given command will be executed on all selected nodes. The command module takes the command name followed by a list of space-delimited arguments. Module documentation and to avoid conflicting with other collections that may have However, we recommend you use the FQCN for easy linking to the In most cases, you can use the shortĬommand even without specifying the collections: keyword. This module is part of ansible-core and included in all Ansible
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |