From 67d64c53225c414b0c0dafbe0a3c4de5ab4ad625 Mon Sep 17 00:00:00 2001 From: Ralph Bean Date: Tue, 16 Jun 2015 13:44:18 +0000 Subject: [PATCH] Try a playbook for taiga. --- .../hosts/taiga.cloud.fedoraproject.org.yml | 6 +- roles/taiga/tasks/main.yml | 95 +++++++++++++++++++ 2 files changed, 97 insertions(+), 4 deletions(-) create mode 100644 roles/taiga/tasks/main.yml diff --git a/playbooks/hosts/taiga.cloud.fedoraproject.org.yml b/playbooks/hosts/taiga.cloud.fedoraproject.org.yml index d0a82a4d06..c0a707f8a4 100644 --- a/playbooks/hosts/taiga.cloud.fedoraproject.org.yml +++ b/playbooks/hosts/taiga.cloud.fedoraproject.org.yml @@ -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 diff --git a/roles/taiga/tasks/main.yml b/roles/taiga/tasks/main.yml new file mode 100644 index 0000000000..decf85d243 --- /dev/null +++ b/roles/taiga/tasks/main.yml @@ -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