The differences and usage scenarios for Shell, command, script, raw modules for Ansbile tools

Source: Internet
Author: User
Tags python script ansible modules

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.