安裝 ansible tower 報錯:
- Failed to start supervisor.service: Unit not found.
安裝步驟沒有錯:
使用yum命令安裝(推薦)
$ sudo su - #切換爲root用戶
# yum install epel-release
# yum install -y supervisor
# systemctl enable supervisord # 開機自啓動
# systemctl start supervisord # 啓動supervisord服務
# systemctl status supervisord # 查看supervisord服務狀態
# ps -ef|grep supervisord # 查看是否存在supervisord進程
但是運行: service supervisor restart 報錯Failed to start supervisor.service: Unit not found
解決方法嘗試:
[root@iz8vb6wnpf70v6mckovd7tz etc]# service supervisor restart
Redirecting to /bin/systemctl restart supervisor.service
Failed to restart supervisor.service: Unit not found.
你這裏就有問題了。你要是用 supervisord -c /etc/supervisord.conf 來啓動進程,就不要用 services 來重啓。 建議你 kill 掉 supervisord,再直接用 services 來啓動 supervisord。
- 報錯:fatal: [localhost]: FAILED! => {"changed": false, "msg": "Could not find the requested service supervisord: host"}
解決方法:
安裝:supervisor
Yum 安裝:
yum –y install supervisor
另外手動下載源文件安裝;
- 報錯:fatal: [localhost]: FAILED! => {"changed": false, "cmd": "awx-manage migrate --noinput", "msg": "[Errno 2] 沒有那個文件或目錄",
嘗試解決方法:
TASK [awx_install : Migrate the Tower database schema (may take awhile when upgrading).] ***
操作報錯 定位到 postgresql 是否安裝完成測試一下
service postgresql-9.4 initdb
service postgresql-9.4 start
如果可以啓動:
則測試是否可以創建連接:
# 創建用戶 su - postgres psql CREATE ROLE awx CREATEDB PASSWORD 'admin' LOGIN; \q exit sed -i 's#peer#md5#g' /var/lib/pgsql/9.4/data/pg_hba.conf sed -i 's#ident#md5#g' /var/lib/pgsql/9.4/data/pg_hba.conf service postgresql-9.4 restart # 測試awx用戶連接,輸入密碼連接,並創建數據庫 psql -U awx -d postgres -h 127.0.0.1 create database awx; \q
4. fatal: [localhost]: FAILED! => {"changed": false, "failed": true, "msg": "This machine does not have sufficient RAM to run Ansible Tower."}
Ansible Tower 官方提供手冊:
安裝要求
系統版本 : Linux 7.4+
內存: 建議至少4G以上
Cpu 兩個以上
解決方法:機器內存不足,增加內存
安裝高版本Linux系統
配置較高性能
tower安裝環境要求
- 操作系統:
- Red Hat Enterprise Linux 7.4或更高版本64位
- CentOS 7.4或更高版本64位
- Ubuntu 14.04 LTS 64位
- Ubuntu 16.04 LTS 64位
- 硬件:
- 最少2個CPU
- 最低4 GB RAM
- 20 GB專用硬盤空間
- 軟件環境:
- Mozilla Firefox或Google Chrome版本瀏覽器
- 運行Ansible Tower 3.2及更高版本需要PostgreSQL 9.6.X以上
- 運行Ansible Tower版本3.2及更高版本需要Ansible 2.2 以上版本
tower 用到的組件:
- postgres
- memcached
- rabbitmq
- nginx
- supervisord
- uwsgi
- django
- celeryd
5.
TASK [postgres : create the postgres user and set the password] ******************************************************
fatal: [localhost]: FAILED! => {"censored": "the output has been hidden due to the fact that 'no_log: true' was specified for this result", "changed": false}
解決方法:
6. fatal: [localhost]: FAILED! => {"changed": false, "failed": true, "msg": "Your current version of Ansible (2.2.1.0) is too old for this version of Ansible Tower. Please upgrade."}
TASK [preflight : Preflight check - require new enough Ansible] ****************
fatal: [localhost]: FAILED! => {"changed": false, "failed": true, "msg": "Your current version of Ansible (2.2.1.0) is too old for this version of Ansible Tower. Please upgrade."}
解決方法:升級 ansible到2.7