ansible之shell模块

例:通过命令对某节点修改时间
[root@master tmp]# ansible slave -m command -a 'date -s "2016/5/13 13:12"'
client02 | SUCCESS | rc=0 >>
Fri May 13 13:12:00 CST 2016
agent.test.com | SUCCESS | rc=0 >>
Fri May 13 13:12:00 CST 2016

[root@master tmp]# ansible slave -m shell -a 'date -s "2016/5/13 13:12"'
client02 | SUCCESS | rc=0 >>
Fri May 13 13:12:00 CST 2016
agent.test.com | SUCCESS | rc=0 >>
Fri May 13 13:12:00 CST 2016

注意:上面的command 可以换成shell

相关文章

用的openwrt路由器,家里宽带申请了动态公网ip,为了方便把2...
#!/bin/bashcommand1&command2&wait从Shell脚本并行...
1.先查出MAMP下面集成的PHP版本cd/Applications/MAMP/bin/ph...
1、先输入locale-a,查看一下现在已安装的语言2、若不存在如...
BashPerlTclsyntaxdiff1.进制数表示Languagebinaryoctalhexa...
正常安装了k8s后,使用kubect工具后接的命令不能直接tab补全...