Do not run matrix-nginx-proxy config injection tasks unless necessary

These `init.yml` (now `inject_into_nginx_proxy.yml`) tasks do not need
to `always` run. They only need to run for `setup-all` and
`setup-nginx-proxy`. Unless we're dealing with these 2 tags, we can
spare ourselves a lot of work.

This patch also moves the `when` statement from `init.yml` into
`main.yml` in an effort to further optimize things by potentially
avoiding the extra file include.
This commit is contained in:
Slavi Pantaleev
2022-11-23 15:52:58 +02:00
parent d829884642
commit 735bacca89
53 changed files with 813 additions and 821 deletions

View File

@ -1,8 +1,10 @@
---
- ansible.builtin.import_tasks: "{{ role_path }}/tasks/init.yml"
- when: matrix_bot_maubot_enabled | bool
ansible.builtin.import_tasks: "{{ role_path }}/tasks/inject_into_nginx_proxy.yml"
tags:
- always
- setup-all
- setup-nginx-proxy
- ansible.builtin.import_tasks: "{{ role_path }}/tasks/validate_config.yml"
when: "run_setup|bool and matrix_bot_maubot_enabled|bool"