Ansible安装
step1:下载epel源,从epel源中下载ansible
yum -y install epel-release
step2:查看epel中的ansible安装包
yum list |grep ansible
step3:安装并且查看版本
yum -y install ansible
ansible --version
step4:修改ansible配置
默认配置文件:/etc/ansible/ansible.cfg
主机与组定义文件: /etc/ansible/hosts
自定义文件:
/root/ansible/ansible.cfg
[defaults]
inventory = /root/ansible/hosts
host_key_checking = False
/root/ansible/hosts
[web]
yw-19
yw-20 =================基于/etc/hosts文件
step5:取消ansible管理主机和被管理主机之间的密码验证
ssh-keygen -N ‘‘ -f /root/.ssh/id_rsa
ssh-copy-id root@被管理主机ip
原文:https://www.cnblogs.com/krystal-LA-zx/p/13051049.html