Ansible Tower 3.2.2 安装 (一)

ansible tower 3.2.2 安装

  • ansible tower 322 安装
  • 下载
  • 解压
  • 修改配置文件
  • 安装
  • 安装过程中遇到的错误
  • 解决方法

下载

下载完整安装包,安装包中包含所有依赖的组件ansible、postgresql等。
下载链接: http://releases.ansible.com/ansible-tower/setup-bundle/

直接wget 最新的安装包
wget http://releases.ansible.com/ansible-tower/setup-bundle/ansible-tower-setup-bundle-latest.el7.tar.gz

解压

tar zxvf ansible-tower-setup-bundle-latest.el7.tar.gz

修改配置文件

cd ansible-tower-setup-bundle-3.2.2-1.el7/

vi inventory

[tower]
localhost ansible_connection=local

[database]

[all:vars]
admin_password='admin'

pg_host=''
pg_port=''

pg_database='awx'
pg_username='awx'
pg_password='admin'

rabbitmq_port=5672
rabbitmq_vhost=tower
rabbitmq_username=tower
rabbitmq_password='admin'
rabbitmq_cookie=cookiemonster

# Needs to be true for fqdns and ip addresses
rabbitmq_use_long_name=false

# Isolated Tower nodes automatically generate an RSA key for authentication;
# To disable this behavior, set this value to false
# isolated_key_generation=true

安装

sh setup.sh

安装过程中遇到的错误

TASK [packages_el : Install postgres] ************************************************************************************
failed: [localhost] (item=[u'postgresql96-server', u'postgresql96-contrib']) => {"changed": false, "item": ["postgresql96-server", "postgresql96-contrib"], "msg": "Error: Package: postgresql96-contrib-9.6.5-1PGDG.rhel7.x86_64 (pgdg96)\n           Requires: postgresql96(x86-64) = 9.6.5-1PGDG.rhel7\n           Installed: postgresql96-9.6.6-1PGDG.rhel7.x86_64 (installed)\n               postgresql96(x86-64) = 9.6.6-1PGDG.rhel7\n           Available: postgresql96-9.6.5-1PGDG.rhel7.x86_64 (pgdg96)\n               postgresql96(x86-64) = 9.6.5-1PGDG.rhel7\nError: Package: postgresql96-contrib-9.6.5-1PGDG.rhel7.x86_64 (pgdg96)\n           Requires: postgresql96-libs(x86-64) = 9.6.5-1PGDG.rhel7\n           Installed: postgresql96-libs-9.6.6-1PGDG.rhel7.x86_64 (installed)\n               postgresql96-libs(x86-64) = 9.6.6-1PGDG.rhel7\n           Available: postgresql96-libs-9.6.5-1PGDG.rhel7.x86_64 (pgdg96)\n               postgresql96-libs(x86-64) = 9.6.5-1PGDG.rhel7\n", "rc": 1, "results": ["postgresql96-server-9.6.6-1PGDG.rhel7.x86_64 providing postgresql96-server is already installed", "Loaded plugins: langpacks, ulninfo\nResolving Dependencies\n--> Running transaction check\n---> Package postgresql96-contrib.x86_64 0:9.6.5-1PGDG.rhel7 will be installed\n--> Processing Dependency: postgresql96-libs(x86-64) = 9.6.5-1PGDG.rhel7 for package: postgresql96-contrib-9.6.5-1PGDG.rhel7.x86_64\n--> Processing Dependency: postgresql96(x86-64) = 9.6.5-1PGDG.rhel7 for package: postgresql96-contrib-9.6.5-1PGDG.rhel7.x86_64\n--> Finished Dependency Resolution\n You could try using --skip-broken to work around the problem\n You could try running: rpm -Va --nofiles --nodigest\n"]}
        to retry, use: --limit @/root/ansible-tower/ansible-tower-setup-bundle-3.2.2-1.el7/install.retry

PLAY RECAP ***************************************************************************************************************
localhost                  : ok=37   changed=4    unreachable=0    failed=1   

解决方法

查看已安装的postgresql,发现并没有完全安装成功。
rpm -qa|grep postg

postgresql96-9.6.5-1PGDG.rhel7.x86_64
pcp-pmda-postgresql-3.10.6-2.el7.x86_64
postgresql96-libs-9.6.5-1PGDG.rhel7.x86_64

进入pg挂载目录手动安装

cd /var/lib/tower-bundle/pgdg96
rpm -Uvh *.rpm

查看是否安装成功,包含以下四个代表安装成功了。
rpm -qa|grep postg

postgresql96-server-9.6.6-1PGDG.rhel7.x86_64
postgresql96-libs-9.6.6-1PGDG.rhel7.x86_64
pcp-pmda-postgresql-3.10.6-2.el7.x86_64
postgresql96-9.6.6-1PGDG.rhel7.x86_64

由于这个版本的postgresql安装判断有问题,所以手动关闭安装postgresql的脚本。

cd ansible-tower-setup-bundle-3.2.2-1.el7/roles/packages_el/tasks/
vi main.yml
把or 修改为and

- include: install_postgres.yml
  when: "packages_el_install_postgres == true **and** config_dynamic_database == 'internal'"

初始化db
/usr/pgsql-9.6/bin/postgresql96-setup initdb
启动postgresql和自启动

systemct enable  postgresql-9.6
systemctl start postgresql-9.6
systemctl status postgresql-9.6

接着执行
sh setup.sh

你可能感兴趣的:(ansible,tower,ansible安装,tower3-2-2,Tower)