[root@ansible-serveransible-tower-setup-3.0.3]# sed -i 's#dl.Fedoraproject.org/pub#mirrors.ustc.edu.cn#g' roles/packages_el/defaults/main.yml
[root@ansible-server ansible-tower-setup-3.0.3]# sed -i 's/#baseurl=/baseurl=/g' roles/packages_el/files/epel-6.repo
[root@ansible-server ansible-tower-setup-3.0.3]# sed -i 's/mirrorlist=/#mirrorlist=/g' roles/packages_el/files/epel-6.repo
[root@ansible-server ansible-tower-setup-3.0.3]# sed -i 's#download.fedoraproject.org/pub#mirrors.ustc.edu.cn#g' roles/packages_el/files/epel-6.repo
[root@ansible-server ansible-tower-setup-3.0.3]# yum -y install centos-release-scl-rh centos-release-scl
[root@ansible-server ansible-tower-setup-3.0.3]# sed -i 's#mirror.centos.org#centos.ustc.edu.cn#g' /etc/yum.repos.d/CentOS-SCLo-scl.repo
[root@ansible-server ansible-tower-setup-3.0.3]# sed -i 's#mirror.centos.org#centos.ustc.edu.cn#g' /etc/yum.repos.d/CentOS-SCLo-scl-rh.repo
[root@ansible-server ansible-tower-setup-3.0.3]# yum -y install supervisor
安装tower
为了防止出现内存过小的报错,修改preflight的tasks文件
[root@ansible-server ansible-tower-setup-3.0.3]# vi roles/preflight/tasks/main.yml
修改下面一行
minimum_var_space: 10000000000
把参数修改到尽量小
minimum_var_space: 100000000
default目录下也是同理
[root@ansible-server ansible-tower-setup-3.0.3]# vi roles/preflight/defaults/main.yml
修改下面一行
minimum_var_space: 10000000000
把参数修改到尽量小
minimum_var_space: 100000000
安装tower
[root@ansible-server ansible-tower-setup-3.0.3]#./setup.sh
如果出现preflight安装的错误,删除roles/preflight/tasks/main.yml文件再尝试
当然也可能因为网络的原因出现timeout的错误,不过没关系再次尝试
如果网络没有问题的话还回出现类似于下面所示的报错:
TASK [awx_install : Migrate the Tower database schema (may take awhile when upgrading).] ***
提示数据库连接不上,解决办法:
启动postgresql
# service postgresql-9.4 initdb
# service postgresql-9.4 start
# chkconfig postgresql-9.4 on
创建用户
# su - postgres
-bash-4.1$ psql
psql (8.4.20)
Type "help" for help.
postgres=# \password postgres;
Enter new password:
Enter it again:
postgres=# CREATE ROLE awx CREATEDB PASSWORD 'admin' LOGIN;
CREATE ROLE
postgres-# \q
[root@ansible-server ~]# sed -i 's#peer#md5#g' /var/lib/pgsql/data/pg_hba.conf
[root@ansible-server ~]# sed -i 's#ident#md5#g' /var/lib/pgsql/data/pg_hba.conf
[root@ansible-server ~]# service postgresql-9.4 restart
Stopping postgresql service: [ OK ]
Starting postgresql service: [ OK ]
测试awx用户连接,输入密码连接,并创建数据库
[root@ansible-server pgsql]# psql -U awx -d postgres -h 127.0.0.1
Password for user awx:
psql (8.4.20)
Type "help" for help.
postgres=> create database awx;
CREATE DATABASE
postgres=> \q
再次执行安装过程
[root@ansible-server ansible-tower-setup-3.0.3]# ./setup.sh
最后出现安装成功的提示说明tower安装完成
三、导入licenses
安装完成后就可以通过https://IP/#来访问你的tower界面了,这里的IP是安装tower的服务器IP
访问如下图所示:
接下来导入我们申请的license
提交后就可以进入tower的管理页面了
下面关于Ansible的文章您也可能喜欢,不妨参考下:
使用Ansible批量管理远程服务器