Shell Module ansible localhost -m shell -a "uptime > uptime. The stream operator, when passed through the shell and command module, will show different results, as the command module doesn’t recognize the stream operators and will throw errors, whereas the same will work fine with the shell module.Ĭommand Module, will throw an error as it will not recognize > stream operator ansible localhost -m command -a "uptime > uptime.txt" The command module is more secured, compared to the shell moduleįor example, both shell and command module will have the same outputs, ansible localhost -m shell -a "uptime" ansible localhost -m command -a "uptime" Stream operators like, &, and | will not work with command modules. The command module will not recognize certain variables like $HOME The command module will execute the commands without proceeding to through the shell. The given command will be executed on all selected nodes. The command module is the default module to execute the binary commands, if we do not specify the module name in our ad-hoc command, ansible will by default use the command module. The command module takes the command name followed by a list of space-delimited arguments. The Shell Module as well as command modules are used to execute Binary Commands.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |