安裝Ansible
1.安裝EPEL源
yum install http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epelrelease-7-5.noarch.rpm
2.yum install -y ansible
或者用rpm方式安裝,需要六個(gè)包:
rpm -ivh python-keyczar-0.71c-2.el7.noarch.rpm
rpm -ivh sshpass-1.05-5.el7.x86_64.rpm
rpm -ivh python-httplib2
rpm -ivh python-jinja2
rpm -ivh python-paramiko
rpm -ivh ansible1.9-1.9.4-2.el7.noarch.rpm
驗(yàn)證:
ansible --version
常見問題:
1.key文件問題及解決方法
a.key文件不是最新
cd /etc/pki/rpm-gpg
wget http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-7 #下載最新的簽名
rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY* #導(dǎo)入簽名key
b.key文件不存在
GPG key retrieval failed: [Errno 14] curl#37 - "Couldn't open file /etc/pki/rpm-gpg/RPM-GPG-KEY*
修改源配置中g(shù)pgcheck=0
find .|xargs grep -ri "RPM-GPG-KEY-CentOS-SIG-Cloud" #查找需要修改的文件
find .|xargs grep -ri "RPM-GPG-KEY-CentOS-SIG-Cloud" -l
安裝openstack-ansible
git clone -b TAG https://github.com/openstack/openstack-ansible.git /opt/openstack-ansible
cd /opt/openstack-ansible
sh scripts/bootstrap-ansible.sh