ansible 學習記錄(一) – ansible 安裝
ansible 學習機器準備
hostname | system | ip | cpu | mem | data | username | passwd | role | ansible |
---|---|---|---|---|---|---|---|---|---|
master | CentOS 7 | 192.168.157.130 | 2核 | 4GB | 30GB | root | 123456 | ansible master | 2.4.2 |
node1 | CentOS 7 | 192.168.157.131 | 2核 | 4GB | 30GB | root | 123456 | ansible node1 | – |
node2 | CentOS 7 | 192.168.157.132 | 2核 | 4GB | 30GB | root | 123456 | ansible node2 | – |
- host 映射配置 – 所有節點
[root@master ~]# echo " " >> /etc/hosts
[root@master ~]# echo "192.168.157.130 master" >> /etc/hosts
[root@master ~]# echo "192.168.157.131 node1" >> /etc/hosts
[root@master ~]# echo "192.168.157.132 node2" >> /etc/hosts
ansible 安裝準備
-
master 安裝 ansible
[root@master ~]# yum install ansible
- 安裝驗證
[root@master ~]# ansible --version