From 027056e0273be8d260648e2472c28a0d4752b802 Mon Sep 17 00:00:00 2001 From: Slavi Pantaleev Date: Wed, 18 Mar 2020 18:24:03 +0200 Subject: [PATCH] Fix weird path creation Fixes #403 (Github Issue). --- .../tasks/setup_install.yml | 11 ++++++----- .../tasks/setup_install.yml | 13 ++++++------- roles/matrix-coturn/tasks/setup_coturn.yml | 6 +++--- roles/matrix-mxisd/tasks/setup_mxisd.yml | 10 +++++----- roles/matrix-riot-web/tasks/setup_riot_web.yml | 8 ++++---- roles/matrix-synapse/tasks/setup_synapse.yml | 12 ++++++------ 6 files changed, 30 insertions(+), 30 deletions(-) diff --git a/roles/matrix-bridge-mautrix-facebook/tasks/setup_install.yml b/roles/matrix-bridge-mautrix-facebook/tasks/setup_install.yml index 5a70c2e43..2656c5ae0 100644 --- a/roles/matrix-bridge-mautrix-facebook/tasks/setup_install.yml +++ b/roles/matrix-bridge-mautrix-facebook/tasks/setup_install.yml @@ -18,16 +18,17 @@ - name: Ensure Mautrix Facebook paths exist file: - path: "{{ item }}" + path: "{{ item.path }}" state: directory mode: 0750 owner: "{{ matrix_user_username }}" group: "{{ matrix_user_username }}" with_items: - - "{{ matrix_mautrix_facebook_base_path }}" - - "{{ matrix_mautrix_facebook_config_path }}" - - "{{ matrix_mautrix_facebook_data_path }}" - - { src: "{{ matrix_mautrix_facebook_docker_src_files_path }}", when: "{{ matrix_mautrix_facebook_container_image_self_build }}" } + - { path: "{{ matrix_mautrix_facebook_base_path }}", when: true } + - { path: "{{ matrix_mautrix_facebook_config_path }}", when: true } + - { path: "{{ matrix_mautrix_facebook_data_path }}", when: true } + - { path: "{{ matrix_mautrix_facebook_docker_src_files_path }}", when: "{{ matrix_mautrix_facebook_container_image_self_build }}" } + when: item.when|bool - name: Ensure Mautrix Facebook repository is present on self-build git: diff --git a/roles/matrix-bridge-mautrix-hangouts/tasks/setup_install.yml b/roles/matrix-bridge-mautrix-hangouts/tasks/setup_install.yml index db1fe736d..a30367f3d 100644 --- a/roles/matrix-bridge-mautrix-hangouts/tasks/setup_install.yml +++ b/roles/matrix-bridge-mautrix-hangouts/tasks/setup_install.yml @@ -18,18 +18,17 @@ - name: Ensure Mautrix Hangouts paths exist file: - path: "{{ item }}" + path: "{{ item.path }}" state: directory mode: 0750 owner: "{{ matrix_user_username }}" group: "{{ matrix_user_username }}" with_items: - - "{{ matrix_mautrix_hangouts_base_path }}" - - "{{ matrix_mautrix_hangouts_config_path }}" - - "{{ matrix_mautrix_hangouts_data_path }}" - - { src: "{{ matrix_mautrix_hangouts_docker_src_files_path }}", when: "{{ matrix_mautrix_hangouts_container_image_self_build }}" } - - when: matrix_mautrix_hangouts_enabled|bool and not matrix_mautrix_hangouts_container_image_self_build + - { path: "{{ matrix_mautrix_hangouts_base_path }}", when: true } + - { path: "{{ matrix_mautrix_hangouts_config_path }}", when: true } + - { path: "{{ matrix_mautrix_hangouts_data_path }}", when: true } + - { path: "{{ matrix_mautrix_hangouts_docker_src_files_path }}", when: "{{ matrix_mautrix_hangouts_container_image_self_build }}" } + when: matrix_mautrix_hangouts_enabled|bool and item.when|bool - name: Ensure Mautrix Hangots repository is present on self build git: diff --git a/roles/matrix-coturn/tasks/setup_coturn.yml b/roles/matrix-coturn/tasks/setup_coturn.yml index d86e4b22f..479e60449 100644 --- a/roles/matrix-coturn/tasks/setup_coturn.yml +++ b/roles/matrix-coturn/tasks/setup_coturn.yml @@ -6,14 +6,14 @@ - name: Ensure Matrix Coturn path exists file: - path: "{{ item }}" + path: "{{ item.path }}" state: directory mode: 0750 owner: "{{ matrix_user_username }}" group: "{{ matrix_user_username }}" with_items: - - { src: "{{ matrix_coturn_docker_src_files_path }}", when: "{{ matrix_coturn_container_image_self_build }}"} - when: matrix_riot_web_enabled|bool + - { path: "{{ matrix_coturn_docker_src_files_path }}", when: "{{ matrix_coturn_container_image_self_build }}"} + when: matrix_riot_web_enabled|bool and item.when - name: Ensure Coturn image is pulled docker_image: diff --git a/roles/matrix-mxisd/tasks/setup_mxisd.yml b/roles/matrix-mxisd/tasks/setup_mxisd.yml index 27c00c70b..aa7801198 100644 --- a/roles/matrix-mxisd/tasks/setup_mxisd.yml +++ b/roles/matrix-mxisd/tasks/setup_mxisd.yml @@ -6,16 +6,16 @@ - name: Ensure mxisd paths exist file: - path: "{{ item }}" + path: "{{ item.path }}" state: directory mode: 0750 owner: "{{ matrix_user_username }}" group: "{{ matrix_user_username }}" with_items: - - "{{ matrix_mxisd_config_path }}" - - "{{ matrix_mxisd_data_path }}" - - { src: "{{ matrix_mxisd_docker_src_files_path }}", when: "{{ matrix_mxisd_container_image_self_build }}"} - when: matrix_mxisd_enabled|bool + - { path: "{{ matrix_mxisd_config_path }}", when: true } + - { path: "{{ matrix_mxisd_data_path }}", when: true } + - { path: "{{ matrix_mxisd_docker_src_files_path }}", when: "{{ matrix_mxisd_container_image_self_build }}"} + when: matrix_mxisd_enabled|bool and item.when - name: Ensure mxisd image is pulled docker_image: diff --git a/roles/matrix-riot-web/tasks/setup_riot_web.yml b/roles/matrix-riot-web/tasks/setup_riot_web.yml index feccbe816..e78da3502 100644 --- a/roles/matrix-riot-web/tasks/setup_riot_web.yml +++ b/roles/matrix-riot-web/tasks/setup_riot_web.yml @@ -6,15 +6,15 @@ - name: Ensure Matrix riot-web path exists file: - path: "{{ item }}" + path: "{{ item.path }}" state: directory mode: 0750 owner: "{{ matrix_user_username }}" group: "{{ matrix_user_username }}" with_items: - - "{{ matrix_riot_web_data_path }}" - - { src: "{{ matrix_riot_web_docker_src_files_path }}", when: "{{ matrix_riot_web_container_image_self_build }}" } - when: matrix_riot_web_enabled|bool + - { path: "{{ matrix_riot_web_data_path }}", when: true } + - { path: "{{ matrix_riot_web_docker_src_files_path }}", when: "{{ matrix_riot_web_container_image_self_build }}" } + when: matrix_riot_web_enabled|bool and item.when - name: Ensure riot-web Docker image is pulled docker_image: diff --git a/roles/matrix-synapse/tasks/setup_synapse.yml b/roles/matrix-synapse/tasks/setup_synapse.yml index 8d5f72d24..c40ae170b 100644 --- a/roles/matrix-synapse/tasks/setup_synapse.yml +++ b/roles/matrix-synapse/tasks/setup_synapse.yml @@ -2,20 +2,20 @@ - name: Ensure Synapse paths exist file: - path: "{{ item }}" + path: "{{ item.path }}" state: directory mode: 0750 owner: "{{ matrix_user_username }}" group: "{{ matrix_user_username }}" with_items: - - "{{ matrix_synapse_config_dir_path }}" - - "{{ matrix_synapse_run_path }}" - - "{{ matrix_synapse_ext_path }}" - - { src: "{{ matrix_synapse_docker_src_files_path }}", when: "{{ matrix_synapse_container_image_self_build }}" } + - { path: "{{ matrix_synapse_config_dir_path }}", when: true } + - { path: "{{ matrix_synapse_run_path }}", when: true } + - { path: "{{ matrix_synapse_ext_path }}", when: true } + - { path: "{{ matrix_synapse_docker_src_files_path }}", when: "{{ matrix_synapse_container_image_self_build }}" } # We handle matrix_synapse_media_store_path elsewhere (in ./synapse/setup_install.yml), # because if it's using Goofys and it's already mounted (from before), # trying to chown/chmod it here will cause trouble. - when: "matrix_synapse_enabled|bool or matrix_s3_media_store_enabled|bool" + when: "(matrix_synapse_enabled|bool or matrix_s3_media_store_enabled|bool) and item.when" - import_tasks: "{{ role_path }}/tasks/ext/setup.yml"