From 904bf5eef4c88801751e5df1944c025f57bafaac Mon Sep 17 00:00:00 2001 From: omgagg Date: Sat, 4 Feb 2023 17:39:31 +0300 Subject: [PATCH] Fix PKCS#12 file creation (#14558) --- roles/strongswan/tasks/openssl.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/roles/strongswan/tasks/openssl.yml b/roles/strongswan/tasks/openssl.yml index f51ac9dd0..188b440df 100644 --- a/roles/strongswan/tasks/openssl.yml +++ b/roles/strongswan/tasks/openssl.yml @@ -155,10 +155,19 @@ format: OpenSSH with_items: "{{ users }}" + - name: Gather the package facts + ansible.builtin.package_facts: + manager: auto + + - name: Get OpenSSL version + set_fact: + openssl_version: "{{ ansible_facts.packages['openssl'][0]['version'] }}" + - name: Build the client's p12 shell: > umask 077; {{ openssl_bin }} pkcs12 + {{ (openssl_version is version('3', '<=')) | ternary('-legacy', '') }} -in certs/{{ item }}.crt -inkey private/{{ item }}.key -export @@ -175,6 +184,7 @@ shell: > umask 077; {{ openssl_bin }} pkcs12 + {{ (openssl_version is version('3', '<=')) | ternary('-legacy', '') }} -in certs/{{ item }}.crt -inkey private/{{ item }}.key -export