2018-02-20 21:28:14 +01:00
|
|
|
---
|
2018-04-07 01:05:23 +02:00
|
|
|
- name: "(Setup: All NGINX) Check NGINX Default Configuration File Exists"
|
|
|
|
stat:
|
|
|
|
path: /etc/nginx/conf.d/default.conf
|
|
|
|
register: default_exists
|
|
|
|
|
|
|
|
- name: "(Setup: All NGINX) Backup NGINX Default Configuration File"
|
|
|
|
copy:
|
|
|
|
remote_src: yes
|
|
|
|
src: /etc/nginx/conf.d/default.conf
|
|
|
|
dest: /etc/nginx/conf.d/default.conf.bak
|
|
|
|
when: default_exists.stat.exists
|
|
|
|
|
|
|
|
- name: "(Setup: All NGINX) Delete NGINX Default Configuration File"
|
|
|
|
file:
|
|
|
|
path: /etc/nginx/conf.d/default.conf
|
|
|
|
state: absent
|
|
|
|
when: default_exists.stat.exists
|
|
|
|
|
2018-02-20 21:28:14 +01:00
|
|
|
- name: "(Setup: All NGINX) Upload NGINX Main Configuration File"
|
|
|
|
copy:
|
|
|
|
src: "{{ main_upload_location }}"
|
|
|
|
dest: /etc/nginx/nginx.conf
|
|
|
|
notify: "(Handler: All OSs) Reload NGINX"
|
|
|
|
when: main_upload_enable
|
|
|
|
|
2018-04-05 23:32:37 +02:00
|
|
|
- name: "(Setup: All NGINX) Ensure NGINX HTTP Directory Exists"
|
|
|
|
file:
|
|
|
|
path: /etc/nginx/conf.d/http
|
|
|
|
state: directory
|
|
|
|
when: http_template_enable
|
|
|
|
|
2018-02-20 21:28:14 +01:00
|
|
|
- name: "(Setup: All NGINX) Upload NGINX HTTP Configuration Files"
|
|
|
|
copy:
|
|
|
|
src: "{{ item }}"
|
2018-04-05 23:32:37 +02:00
|
|
|
dest: /etc/nginx/conf.d/http
|
2018-02-20 21:28:14 +01:00
|
|
|
with_fileglob:
|
|
|
|
- "{{ http_upload_location }}"
|
|
|
|
notify: "(Handler: All OSs) Reload NGINX"
|
|
|
|
when: http_upload_enable
|
|
|
|
|
2018-04-05 23:32:37 +02:00
|
|
|
- name: "(Setup: All NGINX) Ensure NGINX Stream Directory Exists"
|
|
|
|
file:
|
|
|
|
path: /etc/nginx/conf.d/stream
|
|
|
|
state: directory
|
|
|
|
when: stream_template_enable
|
|
|
|
|
2018-02-20 21:28:14 +01:00
|
|
|
- name: "(Setup: All NGINX) Upload NGINX Stream Configuration Files"
|
|
|
|
copy:
|
|
|
|
src: "{{ item }}"
|
2018-04-05 23:32:37 +02:00
|
|
|
dest: /etc/nginx/conf.d/stream
|
2018-02-20 21:28:14 +01:00
|
|
|
with_fileglob:
|
|
|
|
- "{{ stream_upload_location }}"
|
|
|
|
notify: "(Handler: All OSs) Reload NGINX"
|
|
|
|
when: stream_upload_enable
|