mirror of
https://github.com/spantaleev/matrix-docker-ansible-deploy.git
synced 2024-12-26 19:08:31 +01:00
cb323f5b4c
Moving keeps everything in the /matrix directory, so that we wouldn't contaminate anything else on the system or risk clashing with something else. Also retrieving certificates separately for the Riot and Matrix domains, which should help in multiple ways: - allows them to be very different (completely separate base domain..) - allows for Riot to be disabled for the playbook some time later and still have the code not break
55 lines
1.6 KiB
YAML
55 lines
1.6 KiB
YAML
#
|
|
# Tasks related to setting up s3fs
|
|
#
|
|
|
|
- name: Ensure S3fs Docker image is pulled
|
|
docker_image:
|
|
name: "{{ docker_s3fs_image }}"
|
|
when: matrix_s3_media_store_enabled
|
|
|
|
- name: Ensure s3fs-credentials file created
|
|
template:
|
|
src: "{{ role_path }}/templates/s3fs-credentials.j2"
|
|
dest: "{{ matrix_base_data_path }}/s3fs-credentials"
|
|
owner: root
|
|
mode: 0600
|
|
when: matrix_s3_media_store_enabled
|
|
|
|
- name: Ensure matrix-s3fs.service installed
|
|
template:
|
|
src: "{{ role_path }}/templates/systemd/matrix-s3fs.service.j2"
|
|
dest: "/etc/systemd/system/matrix-s3fs.service"
|
|
mode: 0644
|
|
when: matrix_s3_media_store_enabled
|
|
|
|
#
|
|
# Tasks related to getting rid of s3fs (if it was previously enabled)
|
|
#
|
|
|
|
- name: Check existence of matrix-s3fs service
|
|
stat: path="/etc/systemd/system/matrix-s3fs.service"
|
|
register: matrix_s3fs_service_stat
|
|
|
|
- name: Ensure matrix-s3fs is stopped
|
|
service: name=matrix-s3fs state=stopped daemon_reload=yes
|
|
register: stopping_result
|
|
when: "not matrix_s3_media_store_enabled and matrix_s3fs_service_stat.stat.exists"
|
|
|
|
- name: Ensure matrix-s3fs.service doesn't exist
|
|
file:
|
|
path: "/etc/systemd/system/matrix-s3fs.service"
|
|
state: absent
|
|
when: "not matrix_s3_media_store_enabled and matrix_s3fs_service_stat.stat.exists"
|
|
|
|
- name: Ensure s3fs-credentials doesn't exist
|
|
file:
|
|
path: "{{ matrix_base_data_path }}/s3fs-credentials"
|
|
state: absent
|
|
when: "not matrix_s3_media_store_enabled"
|
|
|
|
- name: Ensure S3fs Docker image doesn't exist
|
|
docker_image:
|
|
name: "{{ docker_s3fs_image }}"
|
|
state: absent
|
|
when: "not matrix_s3_media_store_enabled"
|