微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

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

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐