copy tls certs before creating vhosts to avoid validation errors
Some checks failed
continuous-integration/drone/push Build is failing
Some checks failed
continuous-integration/drone/push Build is failing
This commit is contained in:
parent
053b7bfcb6
commit
fe75cf9ee4
@ -106,29 +106,3 @@
|
|||||||
mode: 0750
|
mode: 0750
|
||||||
become: True
|
become: True
|
||||||
become_user: "{{ nginx_user }}"
|
become_user: "{{ nginx_user }}"
|
||||||
|
|
||||||
- block:
|
|
||||||
- name: Add vhost configurations
|
|
||||||
template:
|
|
||||||
src: etc/nginx/sites-available/vhost.j2
|
|
||||||
dest: "/etc/nginx/sites-available/{{ item.file }}"
|
|
||||||
owner: root
|
|
||||||
group: root
|
|
||||||
mode: 0640
|
|
||||||
validate: /bin/bash -c 'nginx -t -c /dev/stdin <<< "events {worker_connections 10;} http { include %s; }"'
|
|
||||||
loop: "{{ nginx_vhosts_default + nginx_vhosts_extra }}"
|
|
||||||
loop_control:
|
|
||||||
label: "{{ item.file }}"
|
|
||||||
notify: __nginx_reload
|
|
||||||
|
|
||||||
- name: Enable vhosts
|
|
||||||
file:
|
|
||||||
src: "/etc/nginx/sites-available/{{ item.file }}"
|
|
||||||
dest: "/etc/nginx/sites-enabled/{{ item.file }}"
|
|
||||||
state: "{{ 'link' if item.enabled | default(True) | bool else 'absent' }}"
|
|
||||||
loop: "{{ nginx_vhosts_default + nginx_vhosts_extra }}"
|
|
||||||
loop_control:
|
|
||||||
label: "{{ item.file }}"
|
|
||||||
notify: __nginx_reload
|
|
||||||
become: True
|
|
||||||
become_user: root
|
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
---
|
---
|
||||||
- import_tasks: install.yml
|
- include_tasks: install.yml
|
||||||
- import_tasks: tls.yml
|
- import_tasks: tls.yml
|
||||||
tags: tls_renewal
|
tags: tls_renewal
|
||||||
- import_tasks: post_tasks.yml
|
- include_tasks: vhost.yml
|
||||||
|
- include_tasks: post_tasks.yml
|
||||||
|
28
tasks/vhost.yml
Normal file
28
tasks/vhost.yml
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
---
|
||||||
|
|
||||||
|
|
||||||
|
- block:
|
||||||
|
- name: Add vhost configurations
|
||||||
|
template:
|
||||||
|
src: etc/nginx/sites-available/vhost.j2
|
||||||
|
dest: "/etc/nginx/sites-available/{{ item.file }}"
|
||||||
|
owner: root
|
||||||
|
group: root
|
||||||
|
mode: 0640
|
||||||
|
validate: /bin/bash -c 'nginx -t -c /dev/stdin <<< "events {worker_connections 10;} http { include %s; }"'
|
||||||
|
loop: "{{ nginx_vhosts_default + nginx_vhosts_extra }}"
|
||||||
|
loop_control:
|
||||||
|
label: "{{ item.file }}"
|
||||||
|
notify: __nginx_reload
|
||||||
|
|
||||||
|
- name: Enable vhosts
|
||||||
|
file:
|
||||||
|
src: "/etc/nginx/sites-available/{{ item.file }}"
|
||||||
|
dest: "/etc/nginx/sites-enabled/{{ item.file }}"
|
||||||
|
state: "{{ 'link' if item.enabled | default(True) | bool else 'absent' }}"
|
||||||
|
loop: "{{ nginx_vhosts_default + nginx_vhosts_extra }}"
|
||||||
|
loop_control:
|
||||||
|
label: "{{ item.file }}"
|
||||||
|
notify: __nginx_reload
|
||||||
|
become: True
|
||||||
|
become_user: root
|
Loading…
Reference in New Issue
Block a user