1、Ansible安裝
采用yum方式進(jìn)行,首先需安裝EPEL源。安裝步驟如下(以centos6.8為例):
# yum install http://mirrors.sohu.com/fedora-epel/6/x86_64/epel-release-6-8.noarch.rpm
# yum install ansible
PS:EPEL (Extra Packages for Enterprise Linux)是基于Fedora的一個(gè)項(xiàng)目,為“紅帽系”的操作系統(tǒng)提供額外的軟件包,適用于RHEL、CentOS和Scientific Linux.
對(duì)于‘centos7’, 請(qǐng)參考: http://www.cnblogs.com/litifeng/p/5716952.html
安裝完成后,Ansible默認(rèn)目錄為/etc/ansible/,該目錄下包含以下幾個(gè)文件:
[root@test6 ~]# cd /etc/ansible/
[root@test6 ansible]# ls -l
total 20
-rw-r--r--. 1 root root 14388 Jan 17 06:35 ansible.cfg
-rw-r--r--. 1 root root 1196 Feb 18 13:53 hosts
drwxr-xr-x. 2 root root 6 Jan 17 06:35 roles
[root@test6 ansible]#
其中,
ansible.cfg :Ansible的配置文件,主要定義了Ansible的默認(rèn)配置部分,后續(xù)將詳細(xì)介紹;
hosts:Ansible默認(rèn)的Inventory文件,主要記錄Ansible配置管理的主機(jī),可進(jìn)行分類。