Ansible Tower最新版本快速安装

安装

下载最新包:

wget http://releases.ansible.com/ansible-tower/setup-bundle/ansible-tower-setup-bundle-latest.el7.tar.gz

安装包中包含所有依赖的组件ansible、postgresql等。

解压

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='fffmo.com'

pg_host=''
pg_port=''

pg_database='fffmo'
pg_username='fffmo'
pg_password='fffmo.com'

rabbitmq_port=5672
rabbitmq_vhost=tower
rabbitmq_username=tower
rabbitmq_password='fffmo.com'
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


正式安装

bash 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 postgre

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

安装

bash setup.sh
赞(1) 打赏
特别声明:除特殊标注,本站文章均为原创,遵循CC BY-NC 3.0,转载请注明出处。三伏磨 » Ansible Tower最新版本快速安装

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

微信扫一扫打赏