From 6c8a0ae56cc9c6613b775946999417fceeed69e8 Mon Sep 17 00:00:00 2001 From: Szymon Cader Date: Mon, 6 Jul 2020 19:45:20 +0200 Subject: [PATCH] fix --- tasks/catchall-vhost.yml | 6 ++++++ tasks/main.yml | 15 ++++++++++++--- tasks/vhosts.yml | 3 --- 3 files changed, 18 insertions(+), 6 deletions(-) diff --git a/tasks/catchall-vhost.yml b/tasks/catchall-vhost.yml index 9a92c34..93d6e85 100644 --- a/tasks/catchall-vhost.yml +++ b/tasks/catchall-vhost.yml @@ -6,14 +6,17 @@ become: yes tags: - nginx + - nginx_catchall_vhost - name: Generate private openssl key openssl_privatekey: path: "{{ nginx_catchall_privkey }}" size: 2048 + select_crypto_backend: cryptography become: yes tags: - nginx + - nginx_catchall_vhost - name: Generate Certificate Signing Request (CSR) openssl_csr: @@ -23,6 +26,7 @@ become: yes tags: - nginx + - nginx_catchall_vhost - name: Generate a Self Signed OpenSSL certificate openssl_certificate: @@ -33,6 +37,7 @@ become: yes tags: - nginx + - nginx_catchall_vhost - name: Create the nginx catch-all template: @@ -41,3 +46,4 @@ become: yes tags: - nginx + - nginx_catchall_vhost diff --git a/tasks/main.yml b/tasks/main.yml index 11e40ae..ca18732 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -12,7 +12,14 @@ when: nginx_user is not defined tags: - always + # Setup/install tasks. +- name: Install cryptography python library + pip: + name: cryptography + tags: + - nginx + - include_tasks: setup-RedHat.yml when: ansible_os_family == 'RedHat' tags: @@ -44,10 +51,12 @@ - always # Vhost configuration. -- import_tasks: vhosts.yml +- include_tasks: catchall-vhost.yml + when: nginx_create_catchall_vhost | default(true) | bool tags: - - nginx - - nginx_vhost + - always + +- import_tasks: vhosts.yml # Nginx setup. - name: Copy nginx configuration in place. diff --git a/tasks/vhosts.yml b/tasks/vhosts.yml index 81c181b..5f90ee4 100644 --- a/tasks/vhosts.yml +++ b/tasks/vhosts.yml @@ -14,9 +14,6 @@ state: directory notify: reload nginx -- include_tasks: catchall-vhost.yml - when: nginx_create_catchall_vhost | default(true) | bool - - name: Add managed vhost config files template: src: "{{ item.template }}"