ansible-role-nginx/tasks/conf/template-config.yml

67 lines
2.3 KiB
YAML
Raw Normal View History

---
- name: "(Setup: All NGINX) Ensure HTML Directory Exists"
file:
path: "{{ item.value.html_file_location }}"
state: directory
with_dict: "{{ nginx_html_demo_template }}"
when: nginx_html_demo_template_enable
- name: "(Setup: All NGINX) Dynamically Generate HTML Files"
template:
src: "{{ item.value.template_file }}"
dest: "{{ item.value.html_file_location }}/{{ item.value.html_file_name }}"
backup: yes
with_dict: "{{ nginx_html_demo_template }}"
when: nginx_html_demo_template_enable
- name: "(Setup: All NGINX) Dynamically Generate NGINX Main Configuration File"
template:
src: "{{ nginx_main_template.template_file }}"
dest: "{{ nginx_main_template.conf_file_location }}/{{ nginx_main_template.conf_file_name }}"
backup: yes
when: nginx_main_template_enable
notify: "(Handler: All OSs) Reload NGINX"
- name: "(Setup: All NGINX) Ensure NGINX HTTP Directory Exists"
2018-04-05 01:48:31 +02:00
file:
path: "{{ item.value.conf_file_location }}"
2018-04-05 01:48:31 +02:00
state: directory
with_dict: "{{ nginx_http_template }}"
when: nginx_http_template_enable
2018-04-05 01:48:31 +02:00
- name: "(Setup: All NGINX) Ensure NGINX Proxy Cache Directories Exists"
file:
path: "{{ item.1.path }}"
state: directory
owner: "{{ nginx_main_template.user }}"
with_subelements:
- "{{ nginx_http_template }}"
- reverse_proxy.proxy_cache_path
- skip_missing: true
when: nginx_http_template_enable
- name: "(Setup: All NGINX) Dynamically Generate NGINX HTTP Configuration Files"
template:
src: "{{ item.value.template_file }}"
dest: "{{ item.value.conf_file_location }}/{{ item.value.conf_file_name }}"
backup: yes
with_dict: "{{ nginx_http_template }}"
when: nginx_http_template_enable
notify: "(Handler: All OSs) Reload NGINX"
- name: "(Setup: All NGINX) Ensure NGINX Stream Directory Exists"
2018-04-05 01:48:31 +02:00
file:
path: "{{ item.value.conf_file_location }}"
2018-04-05 01:48:31 +02:00
state: directory
with_dict: "{{ nginx_stream_template }}"
when: nginx_stream_template_enable
2018-04-05 01:48:31 +02:00
- name: "(Setup: All NGINX) Dynamically Generate NGINX Stream Configuration Files"
template:
src: "{{ item.value.template_file }}"
dest: "{{ item.value.conf_file_location }}/{{ item.value.conf_file_name }}"
backup: yes
with_dict: "{{ nginx_stream_template }}"
when: nginx_stream_template_enable
notify: "(Handler: All OSs) Reload NGINX"