1. 程式人生 > >ansible 2.7.1 快速開始

ansible 2.7.1 快速開始

建議使用Redhat Linux 7.4

0.檢視linux版本

cat /etc/redhat-release

 

1.安裝ansible

yum install ansible -y

檢視ansible版本 

 

2.更新/etc/ansible/hosts

vim /etc/ansible/hosts

新增host記錄,例如

hk.lihuanhuan.net ansible_ssh_user=root ansible_ssh_pass='xxxx'

(如果需要使用金鑰認證方式,請參閱ansible官方手冊)

3.更新/etc/ansible/ansible.cfg

# uncomment this to disable SSH key host checking
host_key_checking = False

4.執行你的第一條ansible命令

ansible all -m ping

5.待續......