ansible
来源:互联网 发布:ubuntu中安装qq国际版 编辑:程序博客网 时间:2024/05/16 06:34
ansible <host-pattern> [-f forks] [-m module_name] [-a args] -f forks: 启动的线程数 -m module_name: 要使用的模块 -a args: 模块特有的参数 ansible-doc -s copy ansible-doc -l 常见模块: command:命令模块 ,默认模块,用于在远程执行命令 ansible all -a 'date' cron: state: present:安装 absent: 移除 */10 * * * /bin/echo 'hello world' ansible web1 -m cron -a "minute='*/10' job='/bin/echo hello world' name='test cron job'" -uroot user: name:指明创建的用户的名字 group: ansible web1 -m group -a 'name=test system=yes' -uroot ansible all -m ping ansible web1 -a 'service nginx status' -uroot service: enabled= : 是否是开机启动,取值为true或者false name=: 服务名称 state=: 状态取值started,stoped,restarted shell: 在远程主机上运行命令 尤其是用到管道等命令 script: 将本地脚本复制到远程主机并运行 注意:使用相对路径指定脚本 yum: 安装程序包 ansible all -m setup 返回主机信息 - host:webservs remote_user: tasks: - task1 modulename: module_args - task2 - host:dbservs
阅读全文
0 0
- ansible
- ansible
- Ansible
- Ansible
- ansible
- Ansible
- ansible
- Ansible
- ansible
- ansible
- Ansible
- Ansible
- Ansible
- ansible
- ansible
- ansible
- ansible
- ansible
- Git笔记
- css dimension
- 如何配置C语言编译环境至MATLAB
- Linux: sudo 和 su 命令异同
- numpy文件存取-npz,npy
- ansible
- 好的文章设计模式
- 【微信公众号开发】自我学习第二章:关注事件触发的自动回复
- biubiubiu
- PDO 链接实例
- pragma once 与 #ifndef _XXX_H_ #define _XXX_H_的区别
- 【math】9.Palindrome Number 回文数字判断
- Android自定义View——展开菜单
- 分录F7字段指定查询对象