has been misunderstood as the shell and command is the execution of remote commands, recently looked at the official help document only to find, made a low-level error, in fact, each module has its own application commonly used; Briefly explain the differences between several common ansible modules, so that they can summarize.
1. Module command details query
Ansible-doc Module Name
2.command module [execute remote command]
Ansible client-m command-a "Uname-n"-s
3.script module [Shell/python script on the remote host execution console]
Ansible client-m script-a "/soft/ntpdate.py"-s
4.shell module [Shell/python script to execute remote host]
Ansible client-m shell-a "/soft/file.py"-s
5.raw module [similar to command module, support pipeline delivery ]
Ansible client-m raw-a "ifconfig eth0|sed-n 2p|awk ' {print \$2} '"-S
This article is from the "ˉt, Stand Wentao ┃﹎" blog, please be sure to keep this source http://hypocritical.blog.51cto.com/3388028/1690804
Differences and usage scenarios for Shell, command, script, raw modules for Ansbile tools