ansible模块command、shell、raw、script
2017-08-29 10:36
477 查看
环境:
ansible端:
ip:192.168.100.129
hostname:node1.lansgg.com
client端:
ip:192.168.100.131
hostname:v2.lansgg.com
ip:192.168.100.132
hostname:v3.lansgg.com
1、命令格式
模块命令详细信息查询
如:
解释:command为模块名, chdir、create 等此模块特有的参数
2、ansible模块之command
此模块为ansible默认执行的模块,也是常用模块之一
示例: 查看远程主机的passwd最后两行
使用参数,修改当然工作目录
command模块 [执行远程命令]
script模块 [在远程主机执行主控端的shell/python脚本 ] (使用相对路径)
shell模块 [执行远程主机的shell/python脚本]
raw模块 [类似于command模块、支持管道传递]
本文出自 “大風” 博客,请务必保留此出处http://lansgg.blog.51cto.com/5675165/1745009
ansible端:
ip:192.168.100.129
hostname:node1.lansgg.com
client端:
ip:192.168.100.131
hostname:v2.lansgg.com
ip:192.168.100.132
hostname:v3.lansgg.com
2、ansible模块之command
此模块为ansible默认执行的模块,也是常用模块之一
示例: 查看远程主机的passwd最后两行
关于ansbile工具的shell、command、script、raw模块的区别和使用场景
command模块 [执行远程命令]相关文章推荐
- ansible模块command、shell、raw、script
- 实例学习ansible系列(4)常用模块之command/shell/raw
- Ansible中shell,command,raw模块的区别
- 关于ansbile工具的shell、command、script、raw模块的区别和使用场景
- ansible执行shell模块和command模块报错| FAILED | rc=127 >> /bin/sh: lsof: command not found和| rc=2 >> [Errno 2] No such file or directory
- linux command Line and shell script bible(笔记八)
- linux command Line and shell script bible(笔记十三)
- Ansible第三课: Command模块
- linux command Line and shell script bible(笔记九)
- linux command Line and shell script bible(笔记十四)
- A Mainframe IDE Powered By Unix Technology [11] - Submit JCL from ftp command or shell script
- linux command Line and shell script bible(笔记十)
- linux command Line and shell script bible(笔记十二)
- 使用ansible 批量操作mongodb(ansible 利用script模块执行脚本)
- linux command Line and shell script bible(笔记十八)
- Ansible系列(4): shell 模块
- linux command Line and shell script bible(笔记十一)
- linux command Line and shell script bible(笔记一_文档/文件系统)
- linux command Line and shell script bible(笔记六_比较)
- ansible command和shell的区别