From e1c8e86700fee1dad7eb0a1199bfcc90a470e7d9 Mon Sep 17 00:00:00 2001 From: Alex Kotov Date: Fri, 3 Jul 2020 09:30:50 +0500 Subject: [PATCH] Move common tasks into separate file --- roles/matrix/tasks/common.yml | 14 ++++++++++++++ roles/matrix/tasks/main.yml | 3 +++ roles/matrix/tasks/synapse.yml | 15 --------------- 3 files changed, 17 insertions(+), 15 deletions(-) create mode 100644 roles/matrix/tasks/common.yml diff --git a/roles/matrix/tasks/common.yml b/roles/matrix/tasks/common.yml new file mode 100644 index 0000000..f1fb83d --- /dev/null +++ b/roles/matrix/tasks/common.yml @@ -0,0 +1,14 @@ +--- +- name: Create Matrix directories + file: + state: directory + path: '{{ item }}' + mode: 'u=rwx,g=rwx,o=rx' + owner: root + group: root + with_items: + - '{{ matrix__conf_dir }}' + - '{{ matrix__opt_dir }}' + - '{{ matrix__lib_dir }}' + - '{{ matrix__log_dir }}' + - '{{ matrix__run_dir }}' diff --git a/roles/matrix/tasks/main.yml b/roles/matrix/tasks/main.yml index 74341bf..62d68f8 100644 --- a/roles/matrix/tasks/main.yml +++ b/roles/matrix/tasks/main.yml @@ -1,4 +1,7 @@ --- +- include_tasks: common.yml +- meta: flush_handlers + - include_tasks: nginx.yml - meta: flush_handlers diff --git a/roles/matrix/tasks/synapse.yml b/roles/matrix/tasks/synapse.yml index dcdc619..44ccafa 100644 --- a/roles/matrix/tasks/synapse.yml +++ b/roles/matrix/tasks/synapse.yml @@ -29,21 +29,6 @@ create_home: false notify: Load, enable and restart Matrix Synapse -- name: Create Matrix directories - file: - state: directory - path: '{{ item }}' - mode: 'u=rwx,g=rwx,o=rx' - owner: root - group: root - with_items: - - '{{ matrix__conf_dir }}' - - '{{ matrix__opt_dir }}' - - '{{ matrix__lib_dir }}' - - '{{ matrix__log_dir }}' - - '{{ matrix__run_dir }}' - notify: Load, enable and restart Matrix Synapse - - name: Create Matrix Synapse directories file: state: directory