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 become: yes
tags: tags:
- nginx - nginx
- nginx_catchall_vhost
- name: Generate private openssl key - name: Generate private openssl key
openssl_privatekey: openssl_privatekey:
path: "{{ nginx_catchall_privkey }}" path: "{{ nginx_catchall_privkey }}"
size: 2048 size: 2048
select_crypto_backend: cryptography
become: yes become: yes
tags: tags:
- nginx - nginx
- nginx_catchall_vhost
- name: Generate Certificate Signing Request (CSR) - name: Generate Certificate Signing Request (CSR)
openssl_csr: openssl_csr:
@ -23,6 +26,7 @@
become: yes become: yes
tags: tags:
- nginx - nginx
- nginx_catchall_vhost
- name: Generate a Self Signed OpenSSL certificate - name: Generate a Self Signed OpenSSL certificate
openssl_certificate: openssl_certificate:
@ -33,6 +37,7 @@
become: yes become: yes
tags: tags:
- nginx - nginx
- nginx_catchall_vhost
- name: Create the nginx catch-all - name: Create the nginx catch-all
template: template:
@ -41,3 +46,4 @@
become: yes become: yes
tags: tags:
- nginx - nginx
- nginx_catchall_vhost

@ -12,7 +12,14 @@
when: nginx_user is not defined when: nginx_user is not defined
tags: tags:
- always - always
# Setup/install tasks. # Setup/install tasks.
- name: Install cryptography python library
pip:
name: cryptography
tags:
- nginx
- include_tasks: setup-RedHat.yml - include_tasks: setup-RedHat.yml
when: ansible_os_family == 'RedHat' when: ansible_os_family == 'RedHat'
tags: tags:
@ -44,10 +51,12 @@
- always - always
# Vhost configuration. # Vhost configuration.
- import_tasks: vhosts.yml - include_tasks: catchall-vhost.yml
when: nginx_create_catchall_vhost | default(true) | bool
tags: tags:
- nginx - always
- nginx_vhost
- import_tasks: vhosts.yml
# Nginx setup. # Nginx setup.
- name: Copy nginx configuration in place. - name: Copy nginx configuration in place.

@ -14,9 +14,6 @@
state: directory state: directory
notify: reload nginx notify: reload nginx
- include_tasks: catchall-vhost.yml
when: nginx_create_catchall_vhost | default(true) | bool
- name: Add managed vhost config files - name: Add managed vhost config files
template: template:
src: "{{ item.template }}" src: "{{ item.template }}"