命令模块
| 序号 | 模块名 | 英文解释 | 中文说明 |
|---|---|---|---|
| 1 | command | Executes a command on a remote node | 在远程节点上执行一个命令 |
| 2 | expect | Executes a command and responds to prompts | — |
| 3 | raw | Executes a low-down and dirty SSH command | — |
| 4 | script | Runs a local script on a remote node after transferring it | — |
| 5 | shell | Execute commands in nodes | — |
| 6 | telnet | Executes a low-down and dirty telnet command | — |
示例
command
1 | - name: return motd to registered var |
expect
1 | - name: Case insensitve password string match |
raw
1 | - name: Bootstrap a legacy python 2.4 host |
script
1 | # Example from Ansible Playbooks |
shell
1 | - name: Execute the command in remote shell; stdout goes to the specified file on the remote. |
telnet
1 | - name: send configuration commands to IOS |
更多详情参考官网