diff --git a/roles/matrix-server/tasks/main.yml b/roles/matrix-server/tasks/main.yml index cd276d68..6f5b7bbe 100644 --- a/roles/matrix-server/tasks/main.yml +++ b/roles/matrix-server/tasks/main.yml @@ -1,81 +1,11 @@ --- -- include: tasks/setup_base.yml - tags: - - setup-all - -- include: tasks/setup_main.yml - tags: - - setup-all - -- include: tasks/setup_ssl.yml - tags: - - setup-all - - setup-ssl +- include: tasks/setup/main.yml - include: tasks/upgrade_postgres.yml tags: - upgrade-postgres -- include: tasks/setup_postgres.yml - tags: - - setup-all - - setup-postgres - -- include: tasks/setup_goofys.yml - tags: - - setup-all - - setup-goofys - -- include: tasks/setup_coturn.yml - tags: - - setup-all - - setup-coturn - -- include: tasks/setup_mailer.yml - tags: - - setup-all - - setup-mailer - -- include: tasks/setup_mxisd.yml - tags: - - setup-all - - setup-mxisd - -- include: tasks/setup_corporal_overrides.yml - tags: - - always - -- include: tasks/setup_corporal.yml - tags: - - setup-all - - setup-corporal - -- include: tasks/setup_synapse.yml - tags: - - setup-all - - setup-synapse - - setup-coturn - -- include: tasks/setup_riot_web.yml - tags: - - setup-all - - setup-riot-web - -- include: tasks/setup_well_known.yml - tags: - - setup-all - - setup-mxisd - - setup-synapse - - setup-nginx-proxy - - setup-well-known - -- include: tasks/setup_nginx_proxy.yml - tags: - - setup-all - - setup-nginx-proxy - - setup-well-known - - include: tasks/start.yml tags: - start @@ -92,7 +22,7 @@ tags: - import-media-store -- include: tasks/self_check.yml +- include: tasks/self_check/main.yml delegate_to: 127.0.0.1 become: false tags: diff --git a/roles/matrix-server/tasks/self_check.yml b/roles/matrix-server/tasks/self_check/main.yml similarity index 100% rename from roles/matrix-server/tasks/self_check.yml rename to roles/matrix-server/tasks/self_check/main.yml diff --git a/roles/matrix-server/tasks/setup/main.yml b/roles/matrix-server/tasks/setup/main.yml new file mode 100644 index 00000000..ac6cb782 --- /dev/null +++ b/roles/matrix-server/tasks/setup/main.yml @@ -0,0 +1,73 @@ +--- + +- include: tasks/setup/setup_base.yml + tags: + - setup-all + +- include: tasks/setup/setup_main.yml + tags: + - setup-all + +- include: tasks/setup/setup_ssl.yml + tags: + - setup-all + - setup-ssl + +- include: tasks/setup/setup_postgres.yml + tags: + - setup-all + - setup-postgres + +- include: tasks/setup/setup_goofys.yml + tags: + - setup-all + - setup-goofys + +- include: tasks/setup/setup_coturn.yml + tags: + - setup-all + - setup-coturn + +- include: tasks/setup/setup_mailer.yml + tags: + - setup-all + - setup-mailer + +- include: tasks/setup/setup_mxisd.yml + tags: + - setup-all + - setup-mxisd + +- include: tasks/setup/setup_corporal_overrides.yml + tags: + - always + +- include: tasks/setup/setup_corporal.yml + tags: + - setup-all + - setup-corporal + +- include: tasks/setup/setup_synapse.yml + tags: + - setup-all + - setup-synapse + - setup-coturn + +- include: tasks/setup/setup_riot_web.yml + tags: + - setup-all + - setup-riot-web + +- include: tasks/setup/setup_well_known.yml + tags: + - setup-all + - setup-mxisd + - setup-synapse + - setup-nginx-proxy + - setup-well-known + +- include: tasks/setup/setup_nginx_proxy.yml + tags: + - setup-all + - setup-nginx-proxy + - setup-well-known \ No newline at end of file diff --git a/roles/matrix-server/tasks/setup_base.yml b/roles/matrix-server/tasks/setup/setup_base.yml similarity index 100% rename from roles/matrix-server/tasks/setup_base.yml rename to roles/matrix-server/tasks/setup/setup_base.yml diff --git a/roles/matrix-server/tasks/setup_corporal.yml b/roles/matrix-server/tasks/setup/setup_corporal.yml similarity index 100% rename from roles/matrix-server/tasks/setup_corporal.yml rename to roles/matrix-server/tasks/setup/setup_corporal.yml diff --git a/roles/matrix-server/tasks/setup_corporal_overrides.yml b/roles/matrix-server/tasks/setup/setup_corporal_overrides.yml similarity index 100% rename from roles/matrix-server/tasks/setup_corporal_overrides.yml rename to roles/matrix-server/tasks/setup/setup_corporal_overrides.yml diff --git a/roles/matrix-server/tasks/setup_coturn.yml b/roles/matrix-server/tasks/setup/setup_coturn.yml similarity index 100% rename from roles/matrix-server/tasks/setup_coturn.yml rename to roles/matrix-server/tasks/setup/setup_coturn.yml diff --git a/roles/matrix-server/tasks/setup_goofys.yml b/roles/matrix-server/tasks/setup/setup_goofys.yml similarity index 100% rename from roles/matrix-server/tasks/setup_goofys.yml rename to roles/matrix-server/tasks/setup/setup_goofys.yml diff --git a/roles/matrix-server/tasks/setup_mailer.yml b/roles/matrix-server/tasks/setup/setup_mailer.yml similarity index 100% rename from roles/matrix-server/tasks/setup_mailer.yml rename to roles/matrix-server/tasks/setup/setup_mailer.yml diff --git a/roles/matrix-server/tasks/setup_main.yml b/roles/matrix-server/tasks/setup/setup_main.yml similarity index 100% rename from roles/matrix-server/tasks/setup_main.yml rename to roles/matrix-server/tasks/setup/setup_main.yml diff --git a/roles/matrix-server/tasks/setup_mxisd.yml b/roles/matrix-server/tasks/setup/setup_mxisd.yml similarity index 100% rename from roles/matrix-server/tasks/setup_mxisd.yml rename to roles/matrix-server/tasks/setup/setup_mxisd.yml diff --git a/roles/matrix-server/tasks/setup_nginx_proxy.yml b/roles/matrix-server/tasks/setup/setup_nginx_proxy.yml similarity index 100% rename from roles/matrix-server/tasks/setup_nginx_proxy.yml rename to roles/matrix-server/tasks/setup/setup_nginx_proxy.yml diff --git a/roles/matrix-server/tasks/setup_postgres.yml b/roles/matrix-server/tasks/setup/setup_postgres.yml similarity index 100% rename from roles/matrix-server/tasks/setup_postgres.yml rename to roles/matrix-server/tasks/setup/setup_postgres.yml diff --git a/roles/matrix-server/tasks/setup_riot_web.yml b/roles/matrix-server/tasks/setup/setup_riot_web.yml similarity index 100% rename from roles/matrix-server/tasks/setup_riot_web.yml rename to roles/matrix-server/tasks/setup/setup_riot_web.yml diff --git a/roles/matrix-server/tasks/setup_ssl.yml b/roles/matrix-server/tasks/setup/setup_ssl.yml similarity index 96% rename from roles/matrix-server/tasks/setup_ssl.yml rename to roles/matrix-server/tasks/setup/setup_ssl.yml index 57b824d7..cabffb81 100644 --- a/roles/matrix-server/tasks/setup_ssl.yml +++ b/roles/matrix-server/tasks/setup/setup_ssl.yml @@ -36,7 +36,7 @@ - "{{ matrix_ssl_config_dir_path }}" - name: Obtain initial certificates - include_tasks: "setup_ssl_for_domain.yml" + include_tasks: "tasks/setup/setup_ssl_for_domain.yml" with_items: "{{ domains_to_obtain_certificate_for }}" loop_control: loop_var: domain_name diff --git a/roles/matrix-server/tasks/setup_ssl_for_domain.yml b/roles/matrix-server/tasks/setup/setup_ssl_for_domain.yml similarity index 100% rename from roles/matrix-server/tasks/setup_ssl_for_domain.yml rename to roles/matrix-server/tasks/setup/setup_ssl_for_domain.yml diff --git a/roles/matrix-server/tasks/setup/setup_synapse.yml b/roles/matrix-server/tasks/setup/setup_synapse.yml new file mode 100644 index 00000000..ecf69fdf --- /dev/null +++ b/roles/matrix-server/tasks/setup/setup_synapse.yml @@ -0,0 +1,7 @@ +--- + +- include: tasks/setup/setup_synapse_pre.yml + +- include: tasks/setup/setup_synapse_ext.yml + +- include: tasks/setup/setup_synapse_main.yml diff --git a/roles/matrix-server/tasks/setup/setup_synapse_ext.yml b/roles/matrix-server/tasks/setup/setup_synapse_ext.yml new file mode 100644 index 00000000..6c6fddda --- /dev/null +++ b/roles/matrix-server/tasks/setup/setup_synapse_ext.yml @@ -0,0 +1,7 @@ +--- + +- include: tasks/setup/setup_synapse_ext_rest_auth.yml + +- include: tasks/setup/setup_synapse_ext_shared_secret_auth.yml + +- include: tasks/setup/setup_synapse_ext_mautrix_telegram.yml diff --git a/roles/matrix-server/tasks/setup_synapse_ext_mautrix_telegram.yml b/roles/matrix-server/tasks/setup/setup_synapse_ext_mautrix_telegram.yml similarity index 100% rename from roles/matrix-server/tasks/setup_synapse_ext_mautrix_telegram.yml rename to roles/matrix-server/tasks/setup/setup_synapse_ext_mautrix_telegram.yml diff --git a/roles/matrix-server/tasks/setup_synapse_ext_rest_auth.yml b/roles/matrix-server/tasks/setup/setup_synapse_ext_rest_auth.yml similarity index 100% rename from roles/matrix-server/tasks/setup_synapse_ext_rest_auth.yml rename to roles/matrix-server/tasks/setup/setup_synapse_ext_rest_auth.yml diff --git a/roles/matrix-server/tasks/setup_synapse_ext_shared_secret_auth.yml b/roles/matrix-server/tasks/setup/setup_synapse_ext_shared_secret_auth.yml similarity index 100% rename from roles/matrix-server/tasks/setup_synapse_ext_shared_secret_auth.yml rename to roles/matrix-server/tasks/setup/setup_synapse_ext_shared_secret_auth.yml diff --git a/roles/matrix-server/tasks/setup_synapse_main.yml b/roles/matrix-server/tasks/setup/setup_synapse_main.yml similarity index 100% rename from roles/matrix-server/tasks/setup_synapse_main.yml rename to roles/matrix-server/tasks/setup/setup_synapse_main.yml diff --git a/roles/matrix-server/tasks/setup_synapse_pre.yml b/roles/matrix-server/tasks/setup/setup_synapse_pre.yml similarity index 100% rename from roles/matrix-server/tasks/setup_synapse_pre.yml rename to roles/matrix-server/tasks/setup/setup_synapse_pre.yml diff --git a/roles/matrix-server/tasks/setup_well_known.yml b/roles/matrix-server/tasks/setup/setup_well_known.yml similarity index 100% rename from roles/matrix-server/tasks/setup_well_known.yml rename to roles/matrix-server/tasks/setup/setup_well_known.yml diff --git a/roles/matrix-server/tasks/setup_synapse.yml b/roles/matrix-server/tasks/setup_synapse.yml deleted file mode 100644 index 5c9348c3..00000000 --- a/roles/matrix-server/tasks/setup_synapse.yml +++ /dev/null @@ -1,7 +0,0 @@ ---- - -- include: tasks/setup_synapse_pre.yml - -- include: tasks/setup_synapse_ext.yml - -- include: tasks/setup_synapse_main.yml diff --git a/roles/matrix-server/tasks/setup_synapse_ext.yml b/roles/matrix-server/tasks/setup_synapse_ext.yml deleted file mode 100644 index 3777df08..00000000 --- a/roles/matrix-server/tasks/setup_synapse_ext.yml +++ /dev/null @@ -1,7 +0,0 @@ ---- - -- include: tasks/setup_synapse_ext_rest_auth.yml - -- include: tasks/setup_synapse_ext_shared_secret_auth.yml - -- include: tasks/setup_synapse_ext_mautrix_telegram.yml diff --git a/roles/matrix-server/tasks/upgrade_postgres.yml b/roles/matrix-server/tasks/upgrade_postgres.yml index cdb39c70..34a78b27 100644 --- a/roles/matrix-server/tasks/upgrade_postgres.yml +++ b/roles/matrix-server/tasks/upgrade_postgres.yml @@ -92,7 +92,7 @@ - debug: msg: "NOTE: Your Postgres data directory has been moved from `{{ matrix_postgres_data_path }}` to `{{ postgres_auto_upgrade_backup_data_path }}`. In the event of failure, you can move it back and run the playbook with --tags=setup-postgres to restore operation." -- include: tasks/setup_postgres.yml +- include: tasks/setup/setup_postgres.yml - name: Ensure matrix-postgres autoruns and is restarted service: name=matrix-postgres enabled=yes state=restarted daemon_reload=yes