2013-03-01 04:39:01 +04:00
---
# tested only on CentOS6, may need adaptations for other operating systems
# TODO: install any ansible plugins we need
# TODO: set up Apache or Nginx to proxy this application
# TODO: setup celery and any worker processes/requirements
- hosts : 127.0 .0 .1
2013-03-14 00:06:19 +04:00
gather_facts : False
2013-03-01 04:39:01 +04:00
user : root
vars_files :
- vars/vars.yml
tasks :
2013-03-14 01:58:06 +04:00
2013-05-21 17:10:48 +04:00
- name : remove python-dateutil package if installed
yum : name=python-dateutil15 state=removed
2013-05-06 23:13:37 +04:00
- name : install packages from yum
yum : name=$item state=installed
with_items :
- libyaml
- gcc
- python-pip
- postgresql # database client
- postgresql-server # database server
- python-psycopg2 # database library
- python-devel # only because pexpect comes from pip
- python-lxml # xml for ?format=xml instead of json (optional)
2013-05-22 03:08:46 +04:00
# python-setuptools package is old (0.6.10, ~2009) vs. latest distribute (0.6.40)
2013-07-08 21:28:56 +04:00
#- name: install latest distribute from pypi
# pip: name=distribute state=latest
2013-05-22 03:08:46 +04:00
2013-07-08 21:28:56 +04:00
#- name: install python modules via pip
# pip: requirements=${working_dir}/requirements/dev.txt
2013-05-06 23:13:37 +04:00
- name : configure the database authentication more or less open for setup
template : src=templates/pg_hba_low.j2 dest=/var/lib/pgsql/data/pg_hba.conf owner=postgres
- name : restart postgresql
service : name=postgresql state=restarted
# took out parameter... db=acom priv=ALL
- name : setup the postgresql user
postgresql_user : >
2013-06-23 21:21:02 +04:00
name=awx
2013-05-06 23:13:37 +04:00
password=${database_password}
login_user=postgres
sudo_user : postgres
- name : create the database
2013-06-23 21:21:02 +04:00
postgresql_db : name=awx state=present
2013-05-06 23:13:37 +04:00
- name : configure the database authentication for runtime mode
template : src=templates/pg_hba.j2 dest=/var/lib/pgsql/data/pg_hba.conf owner=postgres
- name : restart postgresql
service : name=postgresql state=restarted
- name : configure python settings (with database password)
2013-06-23 21:21:02 +04:00
template : src=templates/local_settings.py.j2 dest=${working_dir}/awx/settings/local_settings.py
2013-03-01 04:39:01 +04:00
- name : sync django database
2013-03-14 01:20:50 +04:00
command : python ${working_dir}/manage.py syncdb --noinput
2013-03-01 04:52:14 +04:00
- name : run south migrations
2013-03-13 23:21:06 +04:00
command : python ${working_dir}/manage.py migrate main
2013-03-01 04:39:01 +04:00
2013-03-13 23:15:35 +04:00