Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added back variables which control which parts of the roles are run #2371

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions roles/custom/matrix-bridge-hookshot/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

# A bridge between Matrix and multiple project management services, such as GitHub, GitLab and JIRA.
# Project source code URL: https://github.com/matrix-org/matrix-hookshot
#
run_reset_encryption: true
run_setup: true

matrix_hookshot_enabled: true

Expand Down
8 changes: 4 additions & 4 deletions roles/custom/matrix-bridge-hookshot/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
- tags:
- reset-hookshot-encryption
block:
- when: matrix_hookshot_enabled | bool
- when: matrix_hookshot_enabled | bool and run_reset_encryption | bool
ansible.builtin.include_tasks: "{{ role_path }}/tasks/reset_encryption.yml"

- tags:
Expand All @@ -14,16 +14,16 @@
- install-hookshot
- install-bridge-hookshot
block:
- when: matrix_hookshot_enabled | bool
- when: matrix_hookshot_enabled | bool and run_setup | bool
ansible.builtin.include_tasks: "{{ role_path }}/tasks/validate_config.yml"

- when: matrix_hookshot_enabled | bool
- when: matrix_hookshot_enabled | bool and run_setup | bool
ansible.builtin.include_tasks: "{{ role_path }}/tasks/setup_install.yml"

- tags:
- setup-all
- setup-hookshot
- setup-bridge-hookshot
block:
- when: not matrix_hookshot_enabled | bool
- when: not matrix_hookshot_enabled | bool and run_setup | bool
ansible.builtin.include_tasks: "{{ role_path }}/tasks/setup_uninstall.yml"
3 changes: 3 additions & 0 deletions roles/custom/matrix-client-element/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@

matrix_client_element_enabled: true

run_setup: true
run_self_check: true

matrix_client_element_container_image_self_build: false
matrix_client_element_container_image_self_build_repo: "https://github.com/element-hq/element-web.git"
# Controls whether to patch webpack.config.js when self-building, so that building can pass on low-memory systems (< 4 GB RAM):
Expand Down
6 changes: 3 additions & 3 deletions roles/custom/matrix-client-element/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,18 @@
- when: matrix_client_element_enabled | bool
ansible.builtin.include_tasks: "{{ role_path }}/tasks/prepare_themes.yml"

- when: matrix_client_element_enabled | bool
- when: matrix_client_element_enabled | bool and run_setup | bool
ansible.builtin.include_tasks: "{{ role_path }}/tasks/setup_install.yml"

- tags:
- setup-all
- setup-client-element
block:
- when: not matrix_client_element_enabled | bool
- when: not matrix_client_element_enabled | bool and run_setup | bool
ansible.builtin.include_tasks: "{{ role_path }}/tasks/setup_uninstall.yml"

- tags:
- self-check
block:
- when: matrix_client_element_enabled | bool
- when: matrix_client_element_enabled | bool and run_self_check | bool
ansible.builtin.include_tasks: "{{ role_path }}/tasks/self_check.yml"
1 change: 1 addition & 0 deletions roles/custom/matrix-static-files/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# matrix-static-files is a role which generates and serves `/.well-known/matrix` files for the purposes of Matrix Delegation.
# It also exposes some variables which allow this role to be used for serving additional files.

run_self_check: true
matrix_static_files_enabled: true

matrix_static_files_identifier: matrix-static-files
Expand Down
3 changes: 2 additions & 1 deletion roles/custom/matrix-static-files/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,5 @@
- self-check
- self-check-matrix-static-files
block:
- ansible.builtin.include_tasks: "{{ role_path }}/tasks/self_check_well_known.yml"
- when: run_self_check | bool
ansible.builtin.include_tasks: "{{ role_path }}/tasks/self_check_well_known.yml"
10 changes: 10 additions & 0 deletions roles/custom/matrix-synapse/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,16 @@ matrix_synapse_version: v1.100.0
matrix_synapse_username: ''
matrix_synapse_uid: ''
matrix_synapse_gid: ''
# Variables to control which part of the role is run
# By default they are all true and filtering is done with tags
# these variables are for use from other playbooks etc
run_setup: true
run_self_check: true
run_synapse_register_user: true
run_synapse_update_user_password: true
run_synapse_import_media_store: true
run_synapse_rust_synapse_compress_state: true
run_synapse_import_sqlite_db: true

matrix_synapse_container_image_self_build: false
matrix_synapse_container_image_self_build_repo: "https://github.com/{{ matrix_synapse_github_org_and_repo }}.git"
Expand Down
19 changes: 10 additions & 9 deletions roles/custom/matrix-synapse/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,51 +29,52 @@
- when: matrix_synapse_enabled | bool
ansible.builtin.include_tasks: "{{ role_path }}/tasks/validate_config.yml"

- when: matrix_synapse_enabled | bool
- when: matrix_synapse_enabled | bool and run_setup | bool
ansible.builtin.include_tasks: "{{ role_path }}/tasks/setup_install.yml"

- tags:
- setup-all
- setup-synapse
block:
# This always runs because it handles uninstallation for sub-components too.
- ansible.builtin.include_tasks: "{{ role_path }}/tasks/setup_uninstall.yml"
- when: not matrix_synapse_enabled | bool and run_setup | bool
ansible.builtin.include_tasks: "{{ role_path }}/tasks/setup_uninstall.yml"

- tags:
- import-synapse-media-store
block:
- when: matrix_synapse_enabled | bool
- when: matrix_synapse_enabled | bool and run_synapse_import_media_store | bool
ansible.builtin.include_tasks: "{{ role_path }}/tasks/import_media_store.yml"

- tags:
- import-synapse-sqlite-db
block:
- when: matrix_synapse_enabled | bool
- when: matrix_synapse_enabled | bool and run_synapse_import_sqlite_db
ansible.builtin.include_tasks: "{{ role_path }}/tasks/import_synapse_sqlite_db.yml"

- tags:
- register-user
block:
- when: matrix_synapse_enabled | bool
- when: matrix_synapse_enabled | bool and run_synapse_register_user | bool
ansible.builtin.include_tasks: "{{ role_path }}/tasks/register_user.yml"

- tags:
- update-user-password
block:
- when: matrix_synapse_enabled | bool
- when: matrix_synapse_enabled | bool and run_synapse_update_user_password | bool
ansible.builtin.include_tasks: "{{ role_path }}/tasks/update_user_password.yml"

- tags:
- rust-synapse-compress-state
block:
- when: matrix_synapse_enabled | bool
- when: matrix_synapse_enabled | bool and run_synapse_rust_synapse_compress_state | bool
ansible.builtin.include_tasks: "{{ role_path }}/tasks/rust-synapse-compress-state/main.yml"

- tags:
- self-check
block:
- when: matrix_synapse_enabled | bool
- when: matrix_synapse_enabled | bool and run_self_check | bool
ansible.builtin.include_tasks: "{{ role_path }}/tasks/self_check_client_api.yml"

- when: matrix_synapse_enabled | bool
- when: matrix_synapse_enabled | bool and run_self_check | bool
ansible.builtin.include_tasks: "{{ role_path }}/tasks/self_check_federation_api.yml"
Loading