d294779f8b
All variables are now prefixed with `nginx` - resolves #57
41 lines
1.2 KiB
YAML
41 lines
1.2 KiB
YAML
---
|
|
- name: "(Setup: All NGINX) Dynamically Generate NGINX Main Configuration File"
|
|
template:
|
|
src: nginx.conf.j2
|
|
dest: /etc/nginx/nginx.conf
|
|
backup: yes
|
|
when: nginx_main_template_enable
|
|
notify: "(Handler: All OSs) Reload NGINX"
|
|
|
|
- name: "(Setup: All NGINX) Ensure NGINX HTTP Directory Exists"
|
|
file:
|
|
path: /etc/nginx/conf.d/http
|
|
state: directory
|
|
when: nginx_http_template_enable
|
|
|
|
- name: "(Setup: All NGINX) Dynamically Generate NGINX HTTP Configuration Files"
|
|
template:
|
|
src: "{{ item }}"
|
|
dest: /etc/nginx/conf.d/http/{{ item | basename | regex_replace('\.j2','') }}
|
|
backup: yes
|
|
with_fileglob:
|
|
- "../templates/http/*.j2"
|
|
when: nginx_http_template_enable
|
|
notify: "(Handler: All OSs) Reload NGINX"
|
|
|
|
- name: "(Setup: All NGINX) Ensure NGINX Stream Directory Exists"
|
|
file:
|
|
path: /etc/nginx/conf.d/stream
|
|
state: directory
|
|
when: nginx_stream_template_enable
|
|
|
|
- name: "(Setup: All NGINX) Dynamically Generate NGINX Stream Configuration Files"
|
|
template:
|
|
src: "{{ item }}"
|
|
dest: /etc/nginx/conf.d/stream/{{ item | basename | regex_replace('\.j2','') }}
|
|
backup: yes
|
|
with_fileglob:
|
|
- "../templates/stream/*.j2"
|
|
when: nginx_stream_template_enable
|
|
notify: "(Handler: All OSs) Reload NGINX"
|