随笔分类 - ansible
自动化
摘要:ansible的yum模块,类似于在各自服务器上进行yum state 状态:latest ,present 表示安装 新增; absent 表示卸载 删除; [root@localhost ~]# ansible webservers -m yum -a "name=vim state=lates
阅读全文
摘要:ansible模块常用的有command和shell模块,通过 -m参数指定使用的模块,默认使用command模块,shell模块比默认模块功能强大。 -m copy 拷贝模块 -m file模块 新建目录,递归删除文件,修改文件权限 [root@localhost ~]# ansible webs
阅读全文
摘要:主机清单配置用户密码,就不需要-k 手动输入密码 [root@localhost ~]# cat /etc/ansible/hosts [webservers] 192.168.10.127 http_port=80 ansible_ssh_user=root ansible_ssh_pass='1
阅读全文
摘要:ansible ad-hoc模式: 终端直接输入命令,在ansible中快速执行。 ansible 可以指定某一个具体IP,ip应包括在主机资产清单中,-vvv 显示命令执行详请,一般用于报错问题调试。 -i 指定主机清单的路径 ; -u 远程主机用户名 -K sudo的密码 -b sudo提权 -
阅读全文
摘要:[root@localhost ansible]# vi /etc/ansible/hosts [webservers] 192.168.10.127 http_port=80 192.168.10.128 http_port=8080 [root@localhost ansible]# ansib
阅读全文
摘要:ansible 对主机清单进行磁盘使用查看 vi /etc/ansible/hosts [webservers]## alpha.example.org## beta.example.org## 192.168.1.100## 192.168.1.110 192.168.10.127 192.168
阅读全文
摘要:一、Ansible是什么 Ansible是一个基于Python开发的轻量级自动化运维工具,有着其他自动化运维工具如puppet、cfengine、chef、func、fabric的优点,并且不需要单独安装客户端以及启动服务,只需要通过SSH就可以快速的对大量客户端实现批量系统配置、程序部署、批量运行
阅读全文