From 3aa8c1f62c103149057806e3671fb1da525b3a53 Mon Sep 17 00:00:00 2001 From: Wm Salt Hale Date: Wed, 19 Jan 2022 21:58:39 -0800 Subject: [PATCH 1/2] only enable openssl if necessary --- .../tasks/util/ensure_openssl_installed.yml | 23 +++++++++++++++++ .../tasks/setup_install.yml | 2 ++ roles/matrix-jitsi/tasks/setup_jitsi_base.yml | 2 ++ .../tasks/ssl/setup_ssl_self_signed.yml | 25 ++----------------- 4 files changed, 29 insertions(+), 23 deletions(-) create mode 100644 roles/matrix-base/tasks/util/ensure_openssl_installed.yml diff --git a/roles/matrix-base/tasks/util/ensure_openssl_installed.yml b/roles/matrix-base/tasks/util/ensure_openssl_installed.yml new file mode 100644 index 000000000..c08396574 --- /dev/null +++ b/roles/matrix-base/tasks/util/ensure_openssl_installed.yml @@ -0,0 +1,23 @@ + +# This is for both CentOS 7 and 8 +- name: Ensure openssl installed (CentOS) + yum: + name: + - openssl + state: latest + when: ansible_distribution == 'CentOS' + +# This is for both Debian and Raspbian +- name: Ensure fuse installed (Debian/Raspbian) + apt: + name: + - openssl + state: latest + when: ansible_os_family == 'Debian' + +- name: Ensure fuse installed (Archlinux) + pacman: + name: + - openssl + state: latest + when: ansible_distribution == 'Archlinux' diff --git a/roles/matrix-bridge-appservice-irc/tasks/setup_install.yml b/roles/matrix-bridge-appservice-irc/tasks/setup_install.yml index 20714a41e..63ee6621f 100644 --- a/roles/matrix-bridge-appservice-irc/tasks/setup_install.yml +++ b/roles/matrix-bridge-appservice-irc/tasks/setup_install.yml @@ -1,5 +1,7 @@ --- +- import_tasks: "{{ role_path }}/../matrix-base/tasks/util/ensure_openssl_installed.yml" + - name: Ensure Appservice IRC paths exist file: path: "{{ item.path }}" diff --git a/roles/matrix-jitsi/tasks/setup_jitsi_base.yml b/roles/matrix-jitsi/tasks/setup_jitsi_base.yml index 408027ee0..86e372121 100644 --- a/roles/matrix-jitsi/tasks/setup_jitsi_base.yml +++ b/roles/matrix-jitsi/tasks/setup_jitsi_base.yml @@ -1,5 +1,7 @@ --- +- import_tasks: "{{ role_path }}/../matrix-base/tasks/util/ensure_openssl_installed.yml" + # # Tasks related to setting up jitsi # diff --git a/roles/matrix-nginx-proxy/tasks/ssl/setup_ssl_self_signed.yml b/roles/matrix-nginx-proxy/tasks/ssl/setup_ssl_self_signed.yml index 8fa316da0..47ec40aaf 100644 --- a/roles/matrix-nginx-proxy/tasks/ssl/setup_ssl_self_signed.yml +++ b/roles/matrix-nginx-proxy/tasks/ssl/setup_ssl_self_signed.yml @@ -1,28 +1,7 @@ --- -- name: Ensure OpenSSL installed (RedHat) - yum: - name: - - openssl - state: present - update_cache: no - when: "matrix_ssl_retrieval_method == 'self-signed' and ansible_os_family == 'RedHat'" - -- name: Ensure APT usage dependencies are installed (Debian) - apt: - name: - - openssl - state: present - update_cache: no - when: "matrix_ssl_retrieval_method == 'self-signed' and ansible_os_family == 'Debian'" - -- name: Ensure OpenSSL installed (Archlinux) - pacman: - name: - - openssl - state: latest - update_cache: no - when: "matrix_ssl_retrieval_method == 'self-signed' and ansible_distribution == 'Archlinux'" +- import_tasks: "{{ role_path }}/../matrix-base/tasks/util/ensure_openssl_installed.yml" + when: "matrix_ssl_retrieval_method == 'self-signed'" - name: Generate self-signed certificates include_tasks: "{{ role_path }}/tasks/ssl/setup_ssl_self_signed_obtain_for_domain.yml" From 88b832a8185ada6cc16da38d41d29c74ed9bce85 Mon Sep 17 00:00:00 2001 From: Wm Salt Hale Date: Wed, 19 Jan 2022 22:02:20 -0800 Subject: [PATCH 2/2] updated task names leftover from template used --- roles/matrix-base/tasks/util/ensure_openssl_installed.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/roles/matrix-base/tasks/util/ensure_openssl_installed.yml b/roles/matrix-base/tasks/util/ensure_openssl_installed.yml index c08396574..39442bca9 100644 --- a/roles/matrix-base/tasks/util/ensure_openssl_installed.yml +++ b/roles/matrix-base/tasks/util/ensure_openssl_installed.yml @@ -8,14 +8,14 @@ when: ansible_distribution == 'CentOS' # This is for both Debian and Raspbian -- name: Ensure fuse installed (Debian/Raspbian) +- name: Ensure openssl installed (Debian/Raspbian) apt: name: - openssl state: latest when: ansible_os_family == 'Debian' -- name: Ensure fuse installed (Archlinux) +- name: Ensure openssl installed (Archlinux) pacman: name: - openssl