Add additional changes for Dimension to work

This commit is contained in:
Edgars Voroboks
2019-03-08 15:00:53 +02:00
parent 9735a2f600
commit 1eb78ca93e
7 changed files with 53 additions and 6 deletions

View File

@ -2,6 +2,12 @@
tags:
- always
- import_tasks: "{{ role_path }}/tasks/validate_config.yml"
when: run_setup
tags:
- setup-all
- setup-dimension
- import_tasks: "{{ role_path }}/tasks/setup_dimension.yml"
when: run_setup
tags:

View File

@ -8,16 +8,18 @@
file:
path: "{{ matrix_dimension_base_path }}"
state: directory
mode: 0750
mode: 0770
owner: "{{ matrix_user_username }}"
group: "{{ matrix_user_username }}"
group: "{{ matrix_dimension_user_gid }}"
when: matrix_dimension_enabled
- name: Ensure dimension environment variables file created
template:
src: "{{ role_path }}/templates/config.yaml.j2"
dest: "{{ matrix_dimension_base_path }}/config.yaml"
mode: 0644
mode: 0640
owner: "{{ matrix_user_username }}"
group: "{{ matrix_dimension_user_gid }}"
when: matrix_dimension_enabled
- name: Ensure dimension image is pulled
@ -46,6 +48,7 @@
stat:
path: "/etc/systemd/system/matrix-dimension.service"
register: matrix_dimension_service_stat
when: not matrix_dimension_enabled
- name: Ensure matrix-dimension is stopped
service:

View File

@ -0,0 +1,7 @@
- name: Fail if required Dimension settings not defined
fail:
msg: >-
You need to define a required configuration setting (`{{ item }}`) for using Dimension.
with_items:
- "matrix_dimension_access_token"
when: "matrix_dimension_enabled and vars[item] == ''"