pull/199/head
Szymon Cader 4 years ago
parent dc7d65be05
commit 6c8a0ae56c
  1. 6
      tasks/catchall-vhost.yml
  2. 15
      tasks/main.yml
  3. 3
      tasks/vhosts.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

@ -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.

@ -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 }}"