Replace most import_tasks calls with include_tasks for improved performance

This commit is contained in:
Slavi Pantaleev
2022-11-24 11:33:30 +02:00
parent 5c3df22c35
commit 7c2a7a8eb6
115 changed files with 1175 additions and 1654 deletions

View File

@ -1,32 +1,26 @@
---
- ansible.builtin.import_tasks: "{{ role_path }}/tasks/validate_config.yml"
when: run_setup | bool
- block:
- when: matrix_dendrite_enabled | bool
ansible.builtin.include_tasks: "{{ role_path }}/tasks/validate_config.yml"
- when: matrix_dendrite_enabled | bool
ansible.builtin.include_tasks: "{{ role_path }}/tasks/setup_dendrite.yml"
tags:
- setup-all
- setup-dendrite
- ansible.builtin.import_tasks: "{{ role_path }}/tasks/setup_dendrite.yml"
when: run_setup | bool
tags:
- setup-all
- setup-dendrite
- block:
- when: matrix_dendrite_enabled | bool
ansible.builtin.include_tasks: "{{ role_path }}/tasks/self_check_client_api.yml"
- ansible.builtin.import_tasks: "{{ role_path }}/tasks/register_user.yml"
when: run_dendrite_register_user | bool and matrix_dendrite_enabled | bool
- when: matrix_dendrite_enabled | bool
ansible.builtin.include_tasks: "{{ role_path }}/tasks/self_check_federation_api.yml"
tags:
- self-check
- block:
- when: matrix_dendrite_enabled | bool
ansible.builtin.include_tasks: "{{ role_path }}/tasks/register_user.yml"
tags:
- register-user
- ansible.builtin.import_tasks: "{{ role_path }}/tasks/self_check_client_api.yml"
delegate_to: 127.0.0.1
become: false
when: run_self_check | bool and matrix_dendrite_enabled | bool
tags:
- self-check
- ansible.builtin.import_tasks: "{{ role_path }}/tasks/self_check_federation_api.yml"
delegate_to: 127.0.0.1
become: false
when: run_self_check | bool and matrix_dendrite_enabled | bool
tags:
- self-check

View File

@ -1,4 +1,5 @@
---
- name: Fail if playbook called incorrectly
ansible.builtin.fail:
msg: "The `username` variable needs to be provided to this playbook, via --extra-vars"

View File

@ -7,6 +7,8 @@
register: result_matrix_dendrite_client_api
ignore_errors: true
check_mode: false
delegate_to: 127.0.0.1
become: false
- name: Fail if Matrix Client API not working
ansible.builtin.fail:

View File

@ -7,6 +7,8 @@
register: result_matrix_dendrite_federation_api
ignore_errors: true
check_mode: false
delegate_to: 127.0.0.1
become: false
- name: Fail if Matrix Federation API not working
ansible.builtin.fail: