Przeglądaj źródła

Include ensure_openssl_installed and ensure_fuse_installed utils in a more reliable way

This fixes a regression since the change done in c1c152f7ac.
When another role (say `matrix-jitsi`) included `roles/custom/matrix-base/tasks/util/ensure_openssl_installed.yml`,
which then included `{{ role_path }}/tasks/util/ensure_openssl_installed_DISTRO.yml`,
that `role_path` variable would end up being the parent role
(`matrix-jitsi`) and not the `matrix-base` role, so we'd get a failure.

An alternative solution may have been to avoid using `role_path`, but
importing roles properly (like we've done in this patch) sounds like a better way.

Unfortunately, `import_role` fails if `tasks_from` is something like
`util/ensure_openssl_installed` (containing a `/`), so I had to move
these utils out of `util/`.

Related to https://github.com/spantaleev/matrix-docker-ansible-deploy/issues/2228
pull/2233/head
Slavi Pantaleev 3 lat temu
rodzic
commit
2473cd655b
15 zmienionych plików z 39 dodań i 29 usunięć
  1. +12
    -0
      roles/custom/matrix-base/tasks/ensure_fuse_installed.yml
  2. +0
    -0
      roles/custom/matrix-base/tasks/ensure_fuse_installed_archlinux.yml
  3. +0
    -0
      roles/custom/matrix-base/tasks/ensure_fuse_installed_debian.yml
  4. +0
    -0
      roles/custom/matrix-base/tasks/ensure_fuse_installed_redhat.yml
  5. +12
    -0
      roles/custom/matrix-base/tasks/ensure_openssl_installed.yml
  6. +0
    -0
      roles/custom/matrix-base/tasks/ensure_openssl_installed_archlinux.yml
  7. +0
    -0
      roles/custom/matrix-base/tasks/ensure_openssl_installed_debian.yml
  8. +0
    -0
      roles/custom/matrix-base/tasks/ensure_openssl_installed_redhat.yml
  9. +0
    -12
      roles/custom/matrix-base/tasks/util/ensure_fuse_installed.yml
  10. +0
    -12
      roles/custom/matrix-base/tasks/util/ensure_openssl_installed.yml
  11. +3
    -1
      roles/custom/matrix-bridge-appservice-irc/tasks/setup_install.yml
  12. +3
    -1
      roles/custom/matrix-bridge-hookshot/tasks/setup_install.yml
  13. +3
    -1
      roles/custom/matrix-jitsi/tasks/setup_jitsi_base.yml
  14. +3
    -1
      roles/custom/matrix-nginx-proxy/tasks/ssl/setup_ssl_self_signed.yml
  15. +3
    -1
      roles/custom/matrix-synapse/tasks/goofys/setup_install.yml

+ 12
- 0
roles/custom/matrix-base/tasks/ensure_fuse_installed.yml Wyświetl plik

@@ -0,0 +1,12 @@
---

# This is for both RedHat 7 and 8
- ansible.builtin.include_tasks: "{{ role_path }}/tasks/ensure_fuse_installed_redhat.yml"
when: ansible_os_family == 'RedHat'

# This is for both Debian and Raspbian
- ansible.builtin.include_tasks: "{{ role_path }}/tasks/ensure_fuse_installed_debian.yml"
when: ansible_os_family == 'Debian'

- ansible.builtin.include_tasks: "{{ role_path }}/tasks/ensure_fuse_installed_archlinux.yml"
when: ansible_os_family == 'Archlinux'

roles/custom/matrix-base/tasks/util/ensure_fuse_installed_archlinux.yml → roles/custom/matrix-base/tasks/ensure_fuse_installed_archlinux.yml Wyświetl plik


roles/custom/matrix-base/tasks/util/ensure_fuse_installed_debian.yml → roles/custom/matrix-base/tasks/ensure_fuse_installed_debian.yml Wyświetl plik


roles/custom/matrix-base/tasks/util/ensure_fuse_installed_redhat.yml → roles/custom/matrix-base/tasks/ensure_fuse_installed_redhat.yml Wyświetl plik


+ 12
- 0
roles/custom/matrix-base/tasks/ensure_openssl_installed.yml Wyświetl plik

@@ -0,0 +1,12 @@
---

# This is for both RedHat 7 and 8
- ansible.builtin.include_tasks: "{{ role_path }}/tasks/ensure_openssl_installed_redhat.yml"
when: ansible_os_family == 'RedHat'

# This is for both Debian and Raspbian
- ansible.builtin.include_tasks: "{{ role_path }}/tasks/ensure_openssl_installed_debian.yml"
when: ansible_os_family == 'Debian'

- ansible.builtin.include_tasks: "{{ role_path }}/tasks/ensure_openssl_installed_archlinux.yml"
when: ansible_os_family == 'Archlinux'

roles/custom/matrix-base/tasks/util/ensure_openssl_installed_archlinux.yml → roles/custom/matrix-base/tasks/ensure_openssl_installed_archlinux.yml Wyświetl plik


roles/custom/matrix-base/tasks/util/ensure_openssl_installed_debian.yml → roles/custom/matrix-base/tasks/ensure_openssl_installed_debian.yml Wyświetl plik


roles/custom/matrix-base/tasks/util/ensure_openssl_installed_redhat.yml → roles/custom/matrix-base/tasks/ensure_openssl_installed_redhat.yml Wyświetl plik


+ 0
- 12
roles/custom/matrix-base/tasks/util/ensure_fuse_installed.yml Wyświetl plik

@@ -1,12 +0,0 @@
---

# This is for both RedHat 7 and 8
- ansible.builtin.include_tasks: "{{ role_path }}/tasks/util/ensure_fuse_installed_redhat.yml"
when: ansible_os_family == 'RedHat'

# This is for both Debian and Raspbian
- ansible.builtin.include_tasks: "{{ role_path }}/tasks/util/ensure_fuse_installed_debian.yml"
when: ansible_os_family == 'Debian'

- ansible.builtin.include_tasks: "{{ role_path }}/tasks/util/ensure_fuse_installed_archlinux.yml"
when: ansible_os_family == 'Archlinux'

+ 0
- 12
roles/custom/matrix-base/tasks/util/ensure_openssl_installed.yml Wyświetl plik

@@ -1,12 +0,0 @@
---

# This is for both RedHat 7 and 8
- ansible.builtin.include_tasks: "{{ role_path }}/tasks/util/ensure_openssl_installed_redhat.yml"
when: ansible_os_family == 'RedHat'

# This is for both Debian and Raspbian
- ansible.builtin.include_tasks: "{{ role_path }}/tasks/util/ensure_openssl_installed_debian.yml"
when: ansible_os_family == 'Debian'

- ansible.builtin.include_tasks: "{{ role_path }}/tasks/util/ensure_openssl_installed_archlinux.yml"
when: ansible_os_family == 'Archlinux'

+ 3
- 1
roles/custom/matrix-bridge-appservice-irc/tasks/setup_install.yml Wyświetl plik

@@ -1,6 +1,8 @@
---

- ansible.builtin.import_tasks: "{{ role_path }}/../matrix-base/tasks/util/ensure_openssl_installed.yml"
- ansible.builtin.import_role:
name: custom/matrix-base
tasks_from: ensure_openssl_installed

- name: Ensure Appservice IRC paths exist
ansible.builtin.file:


+ 3
- 1
roles/custom/matrix-bridge-hookshot/tasks/setup_install.yml Wyświetl plik

@@ -1,6 +1,8 @@
---

- ansible.builtin.import_tasks: "{{ role_path }}/../matrix-base/tasks/util/ensure_openssl_installed.yml"
- ansible.builtin.import_role:
name: custom/matrix-base
tasks_from: ensure_openssl_installed

- name: Ensure hookshot paths exist
ansible.builtin.file:


+ 3
- 1
roles/custom/matrix-jitsi/tasks/setup_jitsi_base.yml Wyświetl plik

@@ -1,6 +1,8 @@
---

- ansible.builtin.import_tasks: "{{ role_path }}/../matrix-base/tasks/util/ensure_openssl_installed.yml"
- ansible.builtin.import_role:
name: custom/matrix-base
tasks_from: ensure_openssl_installed

#
# Tasks related to setting up jitsi


+ 3
- 1
roles/custom/matrix-nginx-proxy/tasks/ssl/setup_ssl_self_signed.yml Wyświetl plik

@@ -1,6 +1,8 @@
---

- ansible.builtin.import_tasks: "{{ role_path }}/../matrix-base/tasks/util/ensure_openssl_installed.yml"
- ansible.builtin.import_role:
name: custom/matrix-base
tasks_from: ensure_openssl_installed
when: "matrix_ssl_retrieval_method == 'self-signed'"

- name: Generate self-signed certificates


+ 3
- 1
roles/custom/matrix-synapse/tasks/goofys/setup_install.yml Wyświetl plik

@@ -1,6 +1,8 @@
---

- ansible.builtin.import_tasks: "{{ role_path }}/../matrix-base/tasks/util/ensure_fuse_installed.yml"
- ansible.builtin.import_role:
name: custom/matrix-base
tasks_from: ensure_fuse_installed

- name: Ensure Goofys Docker image is pulled
community.docker.docker_image:


Ładowanie…
Anuluj
Zapisz