refactor based on Slavi's requests
This commit is contained in:
@ -1,9 +1,11 @@
|
||||
matrix_riot_web_enabled: true
|
||||
matrix_riot_web_self_build: false
|
||||
|
||||
matrix_riot_web_docker_image: "vectorim/riot-web:v1.5.12"
|
||||
matrix_riot_web_docker_image_force_pull: "{{ matrix_riot_web_docker_image.endswith(':latest') }}"
|
||||
|
||||
matrix_riot_web_data_path: "{{ matrix_base_data_path }}/riot-web"
|
||||
matrix_docker_riot_web_src_files_path: "{{ matrix_riot_web_data_path }}/docker-src"
|
||||
|
||||
# Controls whether the matrix-riot-web container exposes its HTTP port (tcp/8080 in the container).
|
||||
#
|
||||
|
@ -6,11 +6,14 @@
|
||||
|
||||
- name: Ensure Matrix riot-web path exists
|
||||
file:
|
||||
path: "{{ matrix_riot_web_data_path }}"
|
||||
path: "{{ item }}"
|
||||
state: directory
|
||||
mode: 0750
|
||||
owner: "{{ matrix_user_username }}"
|
||||
group: "{{ matrix_user_username }}"
|
||||
with_items:
|
||||
- "{{ matrix_riot_web_data_path }}"
|
||||
- { src: "{{ matrix_docker_riot_web_src_files_path }}", when: "{{ matrix_riot_web_self_build }}" }
|
||||
when: matrix_riot_web_enabled|bool
|
||||
|
||||
- name: Ensure riot-web Docker image is pulled
|
||||
@ -19,17 +22,17 @@
|
||||
source: "{{ 'pull' if ansible_version.major > 2 or ansible_version.minor > 7 else omit }}"
|
||||
force_source: "{{ matrix_riot_web_docker_image_force_pull if ansible_version.major > 2 or ansible_version.minor >= 8 else omit }}"
|
||||
force: "{{ omit if ansible_version.major > 2 or ansible_version.minor >= 8 else matrix_riot_web_docker_image_force_pull }}"
|
||||
when: matrix_riot_web_enabled|bool and not matrix_raspberry_pi
|
||||
when: matrix_riot_web_enabled|bool and not matrix_riot_web_self_build
|
||||
|
||||
- name: Ensure Riot Web repository is present on Raspberry pi
|
||||
- name: Ensure Riot Web repository is present on self-build
|
||||
git:
|
||||
repo: https://github.com/vector-im/riot-web.git
|
||||
dest: "{{ matrix_docker_riot_web_src_files_path }}"
|
||||
version: "v{{ matrix_riot_web_docker_image.split(':')[1] }}"
|
||||
force: "yes"
|
||||
when: "matrix_riot_web_enabled|bool and matrix_raspberry_pi"
|
||||
when: "matrix_riot_web_enabled|bool and matrix_riot_web_self_build"
|
||||
|
||||
- name: Ensure Riot Web Docker image is build (Raspberry pi)
|
||||
- name: Ensure Riot Web Docker image is build
|
||||
docker_image:
|
||||
name: "{{ matrix_riot_web_docker_image }}"
|
||||
source: build
|
||||
@ -37,7 +40,7 @@
|
||||
dockerfile: Dockerfile
|
||||
path: "{{ matrix_docker_riot_web_src_files_path }}"
|
||||
pull: yes
|
||||
when: "matrix_riot_web_enabled|bool and matrix_raspberry_pi"
|
||||
when: "matrix_riot_web_enabled|bool and matrix_self_build"
|
||||
|
||||
- name: Ensure Matrix riot-web configuration installed
|
||||
copy:
|
||||
|
Reference in New Issue
Block a user