Last active
March 14, 2017 22:20
0.12 migration issue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
yum -y install httpd mod_wsgi gcc python-devel libffi-devel openssl-devel redhat-rpm-config python-setuptools libselinux-python libxml2-devel libxslt-devel | |
setsebool -P httpd_unified 1 | |
easy_install pip | |
pip install "Jinja2<2.9" "ara==0.10" | |
mkdir -p /var/www/ara/{.ansible,.ara} | |
export ANSIBLE_CONFIG=/var/www/ara/ansible.cfg | |
export ARA_DATABASE=sqlite:////var/www/ara/.ara/ansible.sqlite | |
export ara_location=$(python -c "import os,ara; print(os.path.dirname(ara.__file__))") | |
cat << EOF >/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 | |
callback_plugins = $ara_location/plugins/callbacks | |
[ara] | |
# This will default the database and logs location to be inside that directory. | |
dir = /var/www/ara/.ara | |
EOF | |
cat << EOF > playbook.yml | |
--- | |
- name: Something | |
hosts: localhost | |
gather_facts: no | |
tasks: | |
- debug: | |
msg: Something | |
EOF | |
ansible-playbook -i 'localhost' playbook.yml | |
ara playbook list | |
pip install ara==0.11 --upgrade | |
ara --version | |
ara playbook list | |
pip install ara==0.12.3 --upgrade | |
# ara-wsgi landed in 0.12 | |
cp -p $(which ara-wsgi) /var/www/ara/ | |
chown -R apache:apache /var/www/ara | |
cat << EOF > /etc/httpd/conf.d/ara.conf | |
<VirtualHost *:80> | |
# Replace ServerName by your hostname | |
ServerName ara.domain.tld | |
ErrorLog /var/log/httpd/ara-error.log | |
LogLevel warn | |
CustomLog /var/log/httpd/ara-access.log combined | |
WSGIDaemonProcess ara user=apache group=apache 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> | |
EOF | |
systemctl enable httpd | |
systemctl restart httpd | |
ara --version | |
ara playbook list |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment