You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
74 lines
2.1 KiB
74 lines
2.1 KiB
7 years ago
|
---
|
||
|
|
||
7 years ago
|
#
|
||
|
# Tasks related to setting up riot-web
|
||
|
#
|
||
|
|
||
6 years ago
|
- name: Ensure Matrix riot-web path exists
|
||
7 years ago
|
file:
|
||
6 years ago
|
path: "{{ matrix_riot_web_data_path }}"
|
||
7 years ago
|
state: directory
|
||
|
mode: 0750
|
||
|
owner: "{{ matrix_user_username }}"
|
||
|
group: "{{ matrix_user_username }}"
|
||
7 years ago
|
when: matrix_riot_web_enabled
|
||
7 years ago
|
|
||
|
- name: Ensure riot-web Docker image is pulled
|
||
|
docker_image:
|
||
6 years ago
|
name: "{{ matrix_riot_web_docker_image }}"
|
||
7 years ago
|
when: matrix_riot_web_enabled
|
||
7 years ago
|
|
||
|
- name: Ensure Matrix riot-web configured
|
||
|
template:
|
||
6 years ago
|
src: "{{ item.src }}"
|
||
|
dest: "{{ matrix_riot_web_data_path }}/{{ item.name }}"
|
||
7 years ago
|
mode: 0644
|
||
|
owner: "{{ matrix_user_username }}"
|
||
|
group: "{{ matrix_user_username }}"
|
||
|
with_items:
|
||
6 years ago
|
- {src: "{{ role_path }}/templates/config.json.j2", name: "config.json"}
|
||
6 years ago
|
- {src: "{{ matrix_riot_web_homepage_template }}", name: "home.html"}
|
||
7 years ago
|
when: matrix_riot_web_enabled
|
||
7 years ago
|
|
||
|
- name: Ensure matrix-riot-web.service installed
|
||
|
template:
|
||
|
src: "{{ role_path }}/templates/systemd/matrix-riot-web.service.j2"
|
||
|
dest: "/etc/systemd/system/matrix-riot-web.service"
|
||
7 years ago
|
mode: 0644
|
||
|
when: matrix_riot_web_enabled
|
||
|
|
||
|
#
|
||
|
# Tasks related to getting rid of riot-web (if it was previously enabled)
|
||
|
#
|
||
|
|
||
|
- name: Check existence of matrix-riot-web service
|
||
6 years ago
|
stat:
|
||
|
path: "/etc/systemd/system/matrix-riot-web.service"
|
||
7 years ago
|
register: matrix_riot_web_service_stat
|
||
|
|
||
|
- name: Ensure matrix-riot-web is stopped
|
||
6 years ago
|
service:
|
||
|
name: matrix-riot-web
|
||
|
state: stopped
|
||
|
daemon_reload: yes
|
||
7 years ago
|
register: stopping_result
|
||
|
when: "not matrix_riot_web_enabled and matrix_riot_web_service_stat.stat.exists"
|
||
|
|
||
|
- name: Ensure matrix-riot-web.service doesn't exist
|
||
|
file:
|
||
|
path: "/etc/systemd/system/matrix-riot-web.service"
|
||
|
state: absent
|
||
|
when: "not matrix_riot_web_enabled and matrix_riot_web_service_stat.stat.exists"
|
||
|
|
||
|
- name: Ensure Matrix riot-web paths doesn't exist
|
||
|
file:
|
||
6 years ago
|
path: "{{ matrix_riot_web_data_path }}"
|
||
7 years ago
|
state: absent
|
||
|
when: "not matrix_riot_web_enabled"
|
||
|
|
||
|
- name: Ensure riot-web Docker image doesn't exist
|
||
|
docker_image:
|
||
6 years ago
|
name: "{{ matrix_riot_web_docker_image }}"
|
||
7 years ago
|
state: absent
|
||
|
when: "not matrix_riot_web_enabled"
|