安装 Ansible AWX
环境
-
- OS: CentOS Linux release 7.6.1810 (Core)
- Ansible AWX 9.0.1.0
参考资料
安装AWX
https://github.com/ansible/awx/blob/devel/INSTALL.md
这个地方也可以。
https://qiita.com/matchpon23/items/7442632bd23b3cf0554e
https://qiita.com/nakacya/items/b80575210d2168284d89
准备事项
完成上述对于”安装AWX”中的”先决条件”的操作。
此外,也同时进行Python3的安装操作。
Python3 和 Ansible
安装Python3和Ansible
# yum install -y https://centos7.iuscommunity.org/ius-release.rpm
# yum install -y python36 python36-pip python36-devel
# pip3 install --upgrade pip #ここで OS 再起動
# pip3 install ansible
Docker与docker(Python模块)
安装Docker和Docker(Python模块)
# yum install -y yum-utils device-mapper-persistent-data lvm2
# yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
# yum install -y docker-ce docker-ce-cli containerd.io
# systemctl enable docker
# pip install docker
git
安装Git
# yum -y install https://centos7.iuscommunity.org/ius-release.rpm
# yum -y install perl-TermReadKey perl-Error libsecret
# yum --disablerepo=* --enablerepo=ius -y install git2u
Node.js, npm
安装Node.js和npm。
# curl -sL https://rpm.nodesource.com/setup_10.x | bash -
# yum install -y nodejs
# yum install -y gcc-c++ make
Docker Compose:Docker合成
如何安装 Docker Compose?
# pip install docker-compose
安装Ansible AWX
安装 Ansible AWX
# git clone https://github.com/ansible/awx
# cd awx/installer/
# ansible-playbook -i inventory install.yml
可能会输出以下内容。
TASK [local_docker : Start the containers] ************************************************************************
fatal: [localhost]: FAILED! => {"changed": false, "msg": "Failed to import the required Python library (Docker SDK
for Python: docker (Python >= 2.7) or docker-py (Python 2.6)) on localhost.localdomain's Python /usr/bin/python. Pl
ease read module documentation and install in the appropriate location. If the required library is installed, but A
nsible is using the wrong Python interpreter, please consult the documentation on ansible_python_interpreter, for e
xample via `pip install docker` or `pip install docker-py` (Python 2.6). The error was: No module named requests.ex
ceptions"}
在那种情况下,执行以下措施。
#localhost ansible_connection=local ansible_python_interpreter="/usr/bin/env python"
localhost ansible_connection=local ansible_python_interpreter="/usr/bin/python3"