ansible

IT自动化工具

运维工具,被管理端需要启动sshd服务,管理端安装ansible

install

config

/etc/ansible/hosts

FAQ

1.怎么通过ssh账号密码进行管理?

需要安装sshpass工具

/etc/ansible/hosts

[target]

1.1.1.1 ansible_connection=ssh        ansible_user=root ansible_ssh_pass
  1. 如何规避主机检查?

Using a SSH password instead of a key is not possible because Host Key checking is enabled and sshpass does not support this

ansible.cfg

[defaults]
host_key_checking = false

支持项目

1.主机分组管理

2.任务并发控制

3.多master

4.基本功能,可以ping,可以远程执行命令

5.使用场景

软件包升级,或者打补丁

脚本下发,执行

批量配置管理,例如CIS安全配置

基本运维能力

互信测试

主机存活

ansible all -m ping 命令下发

ansible all -m shell -a "echo $PATH"

主机基本信息获取

主机基本配置修改

高级运维能力

playbooks