我正在尝试在Ubuntu16.04上安装ARA (https://github.com/openstack/ara)来监控我的Ansible playbook的执行。
我仔细阅读了文档(http://ara.readthedocs.io/en/latest/webserver.html#debian-ubuntu),但每次测试时都会被重定向到http://ara.home.lab/about
以下是我的配置文件:
Apache Vhost:
cat /etc/apache2/sites-available/ara.conf
<VirtualHost *:80>
# Replace ServerName by your hostname
ServerName ara.home.lab
ErrorLog /var/log/apache2/ara-error.log
LogLevel warn
CustomLog /var/log/apache2/ara-access.log combined
WSGIDaemonProcess ara user=www-data group=www-data processes=4 threads=1
WSGIScriptAlias / /var/www/ara/ara-wsgi
SetEnv ANSIBLE_CONFIG /var/www/ara/ansible.cfg
<Directory /var/www/ara>
WSGIProcessGroup ara
WSGIApplicationGroup %{GLOBAL}
Require all granted
</Directory>
</VirtualHost>可能的配置文件:
cat /var/www/ara/ansible.cfg
[defaults]
# This directory is required to store temporary files for Ansible and ARA
local_tmp = /var/www/ara/.ansible/tmp
[ara]
# This will default the database and logs location to be inside that directory.
dir = /var/www/ara/.araVhost目录:
$ pwd
/var/www/ara
$ ls -la
total 24
drwxr-xr-x 4 www-data www-data 4096 Mar 12 00:15 .
drwxr-xr-x 7 root root 4096 Mar 11 23:59 ..
drwxrwx--- 3 www-data www-data 4096 Oct 27 17:00 .ansible
-rw-r--r-- 1 www-data www-data 234 Oct 27 16:57 ansible.cfg
drwx------ 2 www-data www-data 4096 Mar 12 00:15 .ara
-rwxr-xr-x 1 www-data www-data 1804 Mar 11 01:08 ara-wsgi到目前为止,我还不能从应用程序中找到任何告诉我错误的日志。
你能帮我个忙吗?
发布于 2018-03-13 11:01:49
你的配置看起来不错,但是你遗漏了告诉Ansible它需要加载ARA回调插件的地方,以及它的位置。
要找到ARA在哪里,您可以运行以下命令,无论您运行的是python2还是python3:
$ python -c "import os,ara; print(os.path.dirname(ara.__file__))"如果ARA安装在虚拟环境中,那么在运行该命令之前,您需要获取并激活ARA。
如果它正常工作,它应该打印如下内容:
# The path for your ARA package might be different than this
/usr/local/lib/python2.7/dist-packages/ara要启用ARA作为Ansible回调插件,请将此路径添加到ansible.cfg中的callback_plugins配置:
[defaults]
# This directory is required to store temporary files for Ansible and ARA
local_tmp = /var/www/ara/.ansible/tmp
callback_plugins = /usr/local/lib/python2.7/dist-packages/ara/plugins/callbacks
[ara]
# This will default the database and logs location to be inside that directory.
dir = /var/www/ara/.ara您将能够通过查看/var/www/ara/.ara目录来判断此方法是否有效--当应用程序自我引导时,您将自动创建一个ansible.sqlite文件。
这是您的用户和 Apache需要具有读写访问权限的数据库。这是留给读者的练习,因为它是关于文件系统权限的--一些用户已经创建了一个包含$USER和www-data的通用组。
https://stackoverflow.com/questions/49228837
复制相似问题