mirror of
https://git.lapiole.org/dani/ansible-roles.git
synced 2025-08-06 16:46:54 +02:00
Update to 2022-01-26 18:00
This commit is contained in:
88
roles/taiga/tasks/conf.yml
Normal file
88
roles/taiga/tasks/conf.yml
Normal file
@@ -0,0 +1,88 @@
|
||||
---
|
||||
|
||||
- name: Deploy configuration
|
||||
template: src={{ item.src }} dest={{ item.dest }} group={{ item.group | default(omit) }} mode={{ item.mode | default(omit) }}
|
||||
loop:
|
||||
- src: back/config.py.j2
|
||||
dest: "{{ taiga_root_dir }}/app/back/settings/config.py"
|
||||
group: "{{ taiga_user }}"
|
||||
mode: 640
|
||||
- src: front/conf.json.j2
|
||||
dest: "{{ taiga_root_dir }}/app/front/dist/conf.json"
|
||||
- src: events/env.j2
|
||||
dest: "{{ taiga_root_dir }}/app/events/.env"
|
||||
group: "{{ taiga_user }}"
|
||||
mode: 640
|
||||
- src: protected/env.j2
|
||||
dest: "{{ taiga_root_dir }}/app/protected/.env"
|
||||
group: "{{ taiga_user }}"
|
||||
mode: 640
|
||||
notify: restart taiga
|
||||
tags: taiga
|
||||
|
||||
- name: Deploy nginx configuration
|
||||
template: src=nginx.conf.j2 dest=/etc/nginx/ansible_conf.d/10-taiga.conf
|
||||
notify: reload nginx
|
||||
tags: taiga
|
||||
|
||||
- name: Create RabbitMQ user and vhost
|
||||
shell: |
|
||||
{% if taiga_amqp_user_exists.rc == 0 %}
|
||||
rabbitmqctl change_password {{ taiga_amqp_user }} {{ taiga_amqp_pass }}
|
||||
{% else %}
|
||||
rabbitmqctl add_user {{ taiga_amqp_user }} {{ taiga_amqp_pass }}
|
||||
{% endif %}
|
||||
rabbitmqctl add_vhost {{ taiga_amqp_vhost }}
|
||||
rabbitmqctl set_permissions -p {{ taiga_amqp_vhost }} {{ taiga_amqp_user }} ".*" ".*" ".*"
|
||||
when: taiga_amqp_server in ['localhost', '127.0.0.1']
|
||||
tags: taiga
|
||||
|
||||
- when: taiga_install_mode != 'none'
|
||||
block:
|
||||
|
||||
- name: Migrate database
|
||||
django_manage:
|
||||
command: migrate
|
||||
app_path: "{{ taiga_root_dir }}/app/back"
|
||||
virtualenv: "{{ taiga_root_dir }}/venv"
|
||||
become_user: "{{ taiga_user }}"
|
||||
|
||||
- name: Compile messages
|
||||
django_manage:
|
||||
command: compilemessages
|
||||
app_path: "{{ taiga_root_dir }}/app/back"
|
||||
virtualenv: "{{ taiga_root_dir }}/venv"
|
||||
|
||||
- name: Collect static files
|
||||
django_manage:
|
||||
command: collectstatic
|
||||
app_path: "{{ taiga_root_dir }}/app/back"
|
||||
virtualenv: "{{ taiga_root_dir }}/venv"
|
||||
|
||||
environment:
|
||||
DJANGO_SETTINGS_MODULE: settings.config
|
||||
CELERY_ENABLED: False
|
||||
tags: taiga
|
||||
|
||||
- when: taiga_install_mode == 'install'
|
||||
block:
|
||||
|
||||
- name: Create admin user
|
||||
django_manage:
|
||||
command: createsuperuser --noinput --username admin --email admin@{{ ansible_domain }}
|
||||
app_path: "{{ taiga_root_dir }}/app/back"
|
||||
virtualenv: "{{ taiga_root_dir }}/venv"
|
||||
|
||||
- name: load initial data
|
||||
django_manage:
|
||||
command: loaddata initial_project_templates
|
||||
app_path: "{{ taiga_root_dir }}/app/back"
|
||||
virtualenv: "{{ taiga_root_dir }}/venv"
|
||||
|
||||
environment:
|
||||
DJANGO_SUPERUSER_PASSWORD: '{{ taiga_admin_pass }}'
|
||||
DJANGO_SETTINGS_MODULE: settings.config
|
||||
CELERY_ENABLED: False
|
||||
become_user: "{{ taiga_user }}"
|
||||
when: taiga_install_mode == 'install'
|
||||
tags: taiga
|
Reference in New Issue
Block a user