ansible、ansible tower安装笔记

206 阅读1分钟

ansible、ansible tower安装笔记

相关包下载地址:

releases.ansible.com/ansible-tow…

releases.ansible.com/ansible/

环境说明:
[root@tower ~]# cat /etc/redhat-release 
CentOS Linux release 8.4.2105
[root@tower ~]# ls
ansible-2.9.25.tar.gz  ansible-tower-setup-bundle-3.8.6-2.tar.gz
[root@tower ~]# getenforce 
Disabled
[root@tower ~]#

解压:
[root@tower ~]$ tar -zxvf ansible-2.9.25.tar.gz
[root@tower ~]$  cd ansible-2.9.25/
[root@tower ansible-2.9.25]$
 
使用python安装:
[root@tower ~]#yum install python3-cryptography python3-pyyaml  python3-jinja2.noarch
[root@tower ~]#python3 setup.py build
[root@tower ~]#python3 setup.py install

验证安装:
[root@tower ~]# ansible --version
ansible 2.9.25
  config file = None
  configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/local/lib/python3.6/site-packages/ansible-2.9.25-py3.6.egg/ansible
  executable location = /usr/local/bin/ansible
  python version = 3.6.8 (default, Mar 19 2021, 05:13:41) [GCC 8.4.1 20200928 (Red Hat 8.4.1-1)]
[root@tower ~]# 


安装ansible-tower
[root@tower ~]# tar zxvf ansible-tower-setup-bundle-3.8.6-2.tar.gz
[root@tower ~]# cd ansible-tower-setup-bundle-3.8.6-2
[root@tower ansible-tower-setup-bundle-3.8.6-2]# ls
backup.yml  collections  install.yml  licenses   rekey.yml    roles
bundle      group_vars   inventory    README.md  restore.yml  setup.sh
[root@tower ansible-tower-setup-bundle-3.8.6-2]#
[root@tower ansible-tower-setup-bundle-3.8.6-2]# vim inventory

编辑inventory文件,设置密码
[root@tower ansible-tower-setup-bundle-3.8.6-2]# grep password inventory 
admin_password='1qaz!QAZ'
pg_password='1qaz!QAZ'
automationhub_admin_password='1qaz!QAZ'
automationhub_pg_password='1qaz!QAZ'
[root@tower ansible-tower-setup-bundle-3.8.6-2]#
执行安装:
[root@tower ansible-tower-setup-bundle-3.8.6-2]# ./setup.sh

The setup process completed successfully.

验证测试:
使用浏览器访问主机IP,(https://192.168.168.8/)

清单批量导入(需提前创建inventory清单five):
[root@tower ~]# tower-manage inventory_import --inventory-name=five --source=hosts.txt