Try a playbook for taiga.
This commit is contained in:
parent
de0bbf5317
commit
67d64c5322
2 changed files with 97 additions and 4 deletions
|
@ -30,7 +30,5 @@
|
|||
- name: set hostname (required by some services, at least postfix need it)
|
||||
shell: "hostname {{inventory_hostname}}"
|
||||
|
||||
# TODO -- we don't actually have these yet
|
||||
#roles:
|
||||
#- taiga/frontend
|
||||
#- taiga/backend
|
||||
roles:
|
||||
- taiga
|
||||
|
|
95
roles/taiga/tasks/main.yml
Normal file
95
roles/taiga/tasks/main.yml
Normal file
|
@ -0,0 +1,95 @@
|
|||
# This is mostly following
|
||||
# http://taigaio.github.io/taiga-doc/dist/setup-production.html#circus-and-gunicorn
|
||||
#
|
||||
# It is just for dev/testing.. we're installing stuff from git/pip, etc..
|
||||
#
|
||||
|
||||
- yum: name={{item}} state=present
|
||||
with_items:
|
||||
- nginx
|
||||
- python-psycopg2
|
||||
- libsemanage-python
|
||||
- postgresql-server
|
||||
|
||||
- python3
|
||||
- python3-pip
|
||||
- libxml2-devel
|
||||
- libxslt-devel
|
||||
tags: taiga
|
||||
|
||||
- pip: name={{item}}
|
||||
with_items:
|
||||
#- circus # They recommend circus.. but we'll just used systemd.
|
||||
- gunicorn
|
||||
tags: taiga
|
||||
|
||||
### FIRST, there is a lot of postgres db stuff to setup ###
|
||||
- name: Initialize postgres if necessary
|
||||
command: /usr/bin/postgresql-setup initdb
|
||||
creates=/var/lib/pgsql/data
|
||||
notify: restart postgresql
|
||||
tags: taiga
|
||||
|
||||
|
||||
#- name: Add our postgres config file.
|
||||
# copy: >
|
||||
# src=pg_hba.conf
|
||||
# dest=/var/lib/pgsql/data/pg_hba.conf
|
||||
# owner=postgres
|
||||
# notify: restart postgresql
|
||||
# tags: taiga
|
||||
|
||||
# No need to let postgres talk to the world, right?
|
||||
#- name: Let postgresql listen to '*'
|
||||
# command: sed -i -e "s|#listen_addresses = 'localhost'|listen_addresses = '*'|" /var/lib/pgsql/data/postgresql.conf
|
||||
# notify: restart postgresql
|
||||
# tags: taiga
|
||||
|
||||
## If we want to do backups, we can enable these three tasks
|
||||
#- name: Ensure postgres has a place to backup to
|
||||
# file: dest=/backups state=directory owner=postgres
|
||||
# tags: taiga
|
||||
#
|
||||
#- name: Copy over backup scriplet
|
||||
# copy: src=backup-database dest=/usr/local/bin/backup-database mode=0755
|
||||
# tags: taiga
|
||||
#
|
||||
#- name: Set up some cronjobs to backup databases as configured
|
||||
# template: >
|
||||
# src=cron-backup-database
|
||||
# dest=/etc/cron.d/cron-backup-database-taiga
|
||||
# tags: taiga
|
||||
|
||||
- name: Set postgresql-server to run on boot
|
||||
service: name=postgresql state=running enabled=yes
|
||||
ignore_errors: true
|
||||
notify: restart postgresql
|
||||
tags: taiga
|
||||
|
||||
# Make sure we have db users
|
||||
- postgresql_user: name=taiga
|
||||
# password={{ taiga_db_pass }}
|
||||
tags: taiga
|
||||
|
||||
- postgresql_db: name=taiga owner=taiga encoding=UTF-8
|
||||
tags: taiga
|
||||
### DONE with db stuff
|
||||
|
||||
### NEXT, setup taiga-back from git
|
||||
- file: dest=/srv state=directory
|
||||
tags: taiga
|
||||
|
||||
- git: repo=https://github.com/taigaio/taiga-back.git dest=/srv/taiga-back version=stable
|
||||
tags: taiga
|
||||
|
||||
# TODO -- make this idempotent with creates=...
|
||||
- command: "{{item}}" chdir=/srv/taiga-back
|
||||
with_items:
|
||||
- pip install -r requirements.txt
|
||||
- python manage.py migrate --noinput
|
||||
- python manage.py loaddata initial_user
|
||||
- python manage.py loaddata initial_project_templates
|
||||
- python manage.py loaddata initial_role
|
||||
- python manage.py compilemessages
|
||||
- python manage.py collectstatic --noinput
|
||||
tags: taiga
|
Loading…
Add table
Add a link
Reference in a new issue