Ansible常用命令
来源:互联网 发布:安卓去软件广告 编辑:程序博客网 时间:2024/05/17 02:06
-------------old
# 检查主机连接
# ansible caoguo -m ping
# 执行远程命令
# ansible caoguo -m command -a 'uptime'
# 执行主控端脚本
# ansible caoguo -m script -a '/etc/ansible/script/test.sh'
# 执行远程主机的脚本
# ansible caoguo -m shell -a 'ps aux|grep zabbix'
# 类似shell
# ansible caoguo -m raw -a "ps aux|grep zabbix|awk '{print \$2}'"
# 创建软链接
# ansible caoguo -m file -a "src=/etc/resolv.conf dest=/tmp/resolv.conf state=link"
# 删除软链接
# ansible caoguo -m file -a "path=/tmp/resolv.conf state=absent"
# 复制文件到远程服务器
# ansible caoguo -m copy -a "src=/etc/ansible/ansible.cfg dest=/tmp/ansible.cfg owner=root group=root mode=0644"
------------new
批量后台启动脚本并输出到日志
批量删除test5组服务器的某个文件
ansible test5 -m shell -a "rm -rf /home/ceshi/anhui" -i '/etc/ansible/hosts'
- ansible常用命令
- ansible常用命令
- ansible常用命令
- Ansible常用命令
- ansible常用命令
- ansible常用命令
- Ansible 安装以及常用命令
- ansible常用命令操作
- ansible
- ansible
- Ansible
- Ansible
- ansible
- Ansible
- ansible
- Ansible
- ansible
- ansible
- 阿里带你一起学习企业运维监控平台架构设计与实现
- 如何创建线程
- python re模块
- C/C++:各种基本算法实现小结(三)—— 树与二叉树
- RStudio个性化界面设置
- Ansible常用命令
- MATLAB 神经网络NAR时间序列做预测
- python 过滤html方法
- spark streaming restart error: org.apache.spark.SparkException: Yarn application has already ended!
- Electron打包
- Codeforces 246E Blood Cousins Return
- Codeforces 485D Maximum Value【思维+数论】
- 第一课 Python爬虫初识与网络请求
- Python中:self和__init__的含义 + 为何要有self和__init__