roles/taiga: Deploy Taiga project management app
The *taiga* role installs the three components of Taiga: * taiga-back * taiga-events * taiga-front *taiga-back* is a Python application. Its dependencies are installed via `pip` in the *taiga* user's site-packages, and the application itself is installed by unpacking the archive. *taiga-events* is a Node.js application. Its dependencies are installed by `npm`, and is itself installed by unpacking the archive. Finally, *taiga-front* is a single-page browser application that is installed by unpacking the archive, and served by Apache. Taiga requires PostgreSQL and RabbitMQ.
This commit is contained in:
19
roles/taiga/tasks/main.yml
Normal file
19
roles/taiga/tasks/main.yml
Normal file
@@ -0,0 +1,19 @@
|
||||
- import_tasks: postgresql.yml
|
||||
- import_tasks: rabbitmq.yml
|
||||
|
||||
- import_tasks: taiga-back.yml
|
||||
- import_tasks: taiga-front.yml
|
||||
- import_tasks: taiga-events.yml
|
||||
|
||||
- name: ensure apache is configured to serve taiga
|
||||
copy:
|
||||
src: taiga.httpd.conf
|
||||
dest: /etc/httpd/conf.d/taiga.conf
|
||||
mode: '0644'
|
||||
notify:
|
||||
- reload httpd
|
||||
- name: ensure selinux allows apache to proxy for taiga
|
||||
seboolean:
|
||||
name: httpd_can_network_connect
|
||||
state: true
|
||||
persistent: true
|
||||
19
roles/taiga/tasks/postgresql.yml
Normal file
19
roles/taiga/tasks/postgresql.yml
Normal file
@@ -0,0 +1,19 @@
|
||||
- name: ensure taiga postgresql user exists
|
||||
become: true
|
||||
become_user: postgres
|
||||
postgresql_user:
|
||||
name=taiga
|
||||
state=present
|
||||
|
||||
- name: ensure taiga postgresql database exists
|
||||
become: true
|
||||
become_user: postgres
|
||||
postgresql_db:
|
||||
name=taiga
|
||||
owner=taiga
|
||||
encoding=utf-8
|
||||
lc_collate=en_US.UTF-8
|
||||
lc_ctype=en_US.UTF-8
|
||||
state=present
|
||||
notify:
|
||||
- migrate taiga data
|
||||
14
roles/taiga/tasks/rabbitmq.yml
Normal file
14
roles/taiga/tasks/rabbitmq.yml
Normal file
@@ -0,0 +1,14 @@
|
||||
- name: ensure taiga rabbitmq vhost exists
|
||||
rabbitmq_vhost:
|
||||
name=taiga
|
||||
state=present
|
||||
- name: ensure taiga rabbitmq user exists
|
||||
rabbitmq_user:
|
||||
name: taiga
|
||||
password: '{{ taiga_events_password }}'
|
||||
permissions:
|
||||
- vhost: taiga
|
||||
configure_priv: .*
|
||||
read_priv: .*
|
||||
write_priv: .*
|
||||
state: present
|
||||
73
roles/taiga/tasks/taiga-back.yml
Normal file
73
roles/taiga/tasks/taiga-back.yml
Normal file
@@ -0,0 +1,73 @@
|
||||
- name: ensure system dependencies are installed
|
||||
package:
|
||||
name:
|
||||
- gzip
|
||||
- libjpeg
|
||||
- python3-psycopg2
|
||||
- '{{ taiga_python_package }}'
|
||||
- sudo
|
||||
- tar
|
||||
- zlib
|
||||
state: present
|
||||
tags:
|
||||
- install
|
||||
|
||||
- name: ensure taiga user exists
|
||||
user:
|
||||
name: taiga
|
||||
system: yes
|
||||
home: /var/lib/taiga
|
||||
state: present
|
||||
|
||||
- name: ensure taiga dependencies are installed
|
||||
environment:
|
||||
PIP_NO_INDEX: t
|
||||
PIP_FIND_LINKS: '{{ taiga_pip_url }}'
|
||||
PIP_TRUSTED_HOST: '{{ taiga_pip_url|urlsplit("hostname") }}'
|
||||
pip:
|
||||
requirements: '{{ taiga_pip_url }}/requirements.txt'
|
||||
virtualenv: /usr/local/lib/taiga/venv
|
||||
virtualenv_command: '{{ taiga_python_exe }} -m venv'
|
||||
state: present
|
||||
- name: ensure taiga-back is installed
|
||||
unarchive:
|
||||
src: '{{ taiga_back_url }}'
|
||||
dest: /usr/local/lib/taiga/
|
||||
remote_src: true
|
||||
notify:
|
||||
- migrate taiga data
|
||||
- compile taiga messages
|
||||
- collect taiga static data
|
||||
|
||||
- name: ensure taiga media directory exists
|
||||
file:
|
||||
path: /usr/local/lib/taiga/taiga-back/media
|
||||
owner: taiga
|
||||
group: taiga
|
||||
mode: '0755'
|
||||
state: directory
|
||||
|
||||
- name: ensure taiga-back is configured
|
||||
template:
|
||||
src: settings.py.j2
|
||||
dest: /usr/local/lib/taiga/taiga-back/settings/local.py
|
||||
|
||||
- name: ensure taiga-back entry point script is installed
|
||||
copy:
|
||||
src: taiga-back.sh
|
||||
dest: /usr/local/libexec/taiga-back.sh
|
||||
mode: '0755'
|
||||
notify:
|
||||
- restart taiga
|
||||
- name: ensure taiga systemd unit is installed
|
||||
copy:
|
||||
src: taiga.service
|
||||
dest: /etc/systemd/system/taiga.service
|
||||
mode: '0644'
|
||||
notify:
|
||||
- reload systemd
|
||||
- restart taiga
|
||||
- name: ensure taiga starts at boot
|
||||
service:
|
||||
name: taiga
|
||||
enabled: yes
|
||||
52
roles/taiga/tasks/taiga-events.yml
Normal file
52
roles/taiga/tasks/taiga-events.yml
Normal file
@@ -0,0 +1,52 @@
|
||||
- name: ensure nodejs is installed
|
||||
package:
|
||||
name:
|
||||
- nodejs
|
||||
- npm
|
||||
state: present
|
||||
tags:
|
||||
- install
|
||||
|
||||
- name: ensure taiga-events directory exists
|
||||
file:
|
||||
path: /usr/local/lib/taiga/taiga-events
|
||||
owner: taiga
|
||||
group: taiga
|
||||
mode: '0755'
|
||||
state: directory
|
||||
- name: ensure taiga-events is installed
|
||||
become: true
|
||||
become_user: taiga
|
||||
unarchive:
|
||||
src: '{{ taiga_events_url }}'
|
||||
dest: /usr/local/lib/taiga/
|
||||
remote_src: true
|
||||
|
||||
- name: ensure taiga-events dependencies are installed
|
||||
become: true
|
||||
become_user: taiga
|
||||
npm:
|
||||
path: /usr/local/lib/taiga/taiga-events
|
||||
|
||||
- name: ensure taiga-events is configured
|
||||
template:
|
||||
src: taiga-events.config.json.j2
|
||||
dest: /usr/local/lib/taiga/taiga-events/config.json
|
||||
owner: root
|
||||
group: taiga
|
||||
mode: '0750'
|
||||
notify:
|
||||
- restart taiga-events
|
||||
|
||||
- name: ensure taiga-events systemd unit is installed
|
||||
copy:
|
||||
src: taiga-events.service
|
||||
dest: /etc/systemd/system/taiga-events.service
|
||||
mode: '0644'
|
||||
notify:
|
||||
- reload systemd
|
||||
- restart taiga-events
|
||||
- name: ensure taiga-events starts at boot
|
||||
service:
|
||||
name: taiga-events
|
||||
enabled: yes
|
||||
11
roles/taiga/tasks/taiga-front.yml
Normal file
11
roles/taiga/tasks/taiga-front.yml
Normal file
@@ -0,0 +1,11 @@
|
||||
- name: ensure taiga-front is installed
|
||||
unarchive:
|
||||
src: '{{ taiga_front_url }}'
|
||||
dest: /usr/local/lib/taiga/
|
||||
remote_src: true
|
||||
|
||||
- name: ensure taiga-front is configured
|
||||
template:
|
||||
src: taiga-front.conf.json.j2
|
||||
dest: /usr/local/lib/taiga/taiga-front-dist/dist/conf.json
|
||||
mode: '0644'
|
||||
Reference in New Issue
Block a user