2020-09-15 21:27:06 +02:00
|
|
|
## DEPRECATED -- Use nginxinc.nginx_config role instead (https://github.com/nginxinc/ansible-role-nginx-config)
|
2018-02-20 21:28:14 +01:00
|
|
|
---
|
2020-09-15 21:27:06 +02:00
|
|
|
- name: "Deprecation warning"
|
|
|
|
debug:
|
|
|
|
msg: "DEPRECATED TASKS -- Use nginxinc.nginx_config role instead (https://github.com/nginxinc/ansible-role-nginx-config)"
|
|
|
|
|
|
|
|
- name: "(DEPRECATED) Ensure HTML Directory Exists"
|
2018-10-16 20:52:04 +02:00
|
|
|
file:
|
2019-05-21 17:23:06 +02:00
|
|
|
path: "{{ item.value.html_file_location | default('/usr/share/nginx/html') }}"
|
2018-10-16 20:52:04 +02:00
|
|
|
state: directory
|
2020-08-28 10:30:23 +02:00
|
|
|
mode: 0755
|
2018-10-16 20:52:04 +02:00
|
|
|
with_dict: "{{ nginx_html_demo_template }}"
|
2019-08-07 22:16:27 +02:00
|
|
|
when: nginx_html_demo_template_enable | bool
|
2018-10-16 20:52:04 +02:00
|
|
|
|
2020-09-15 21:27:06 +02:00
|
|
|
- name: "(DEPRECATED) Dynamically Generate HTML Files"
|
2018-10-16 20:52:04 +02:00
|
|
|
template:
|
2019-05-21 17:23:06 +02:00
|
|
|
src: "{{ item.value.template_file | default('www/index.html.j2') }}"
|
|
|
|
dest: "{{ item.value.html_file_location | default('/usr/share/nginx/html') }}/{{ item.value.html_file_name | default('index.html') }}"
|
2019-02-15 15:51:09 +01:00
|
|
|
backup: yes
|
2020-08-28 10:30:23 +02:00
|
|
|
mode: 0644
|
2018-10-16 20:52:04 +02:00
|
|
|
with_dict: "{{ nginx_html_demo_template }}"
|
2019-08-07 22:16:27 +02:00
|
|
|
when: nginx_html_demo_template_enable | bool
|
2018-10-16 20:52:04 +02:00
|
|
|
|
2020-09-15 21:27:06 +02:00
|
|
|
- name: "(DEPRECATED) Ensure NGINX Main Directory Exists"
|
2019-05-21 17:23:06 +02:00
|
|
|
file:
|
|
|
|
path: "{{ nginx_main_template.conf_file_location | default('/etc/nginx') }}"
|
|
|
|
state: directory
|
2020-08-28 10:30:23 +02:00
|
|
|
mode: 0755
|
2019-08-07 22:16:27 +02:00
|
|
|
when: nginx_main_template_enable | bool
|
2019-05-21 17:23:06 +02:00
|
|
|
|
2020-09-15 21:27:06 +02:00
|
|
|
- name: "(DEPRECATED) Dynamically Generate NGINX Main Configuration File"
|
2018-02-20 21:28:14 +01:00
|
|
|
template:
|
2019-05-21 17:23:06 +02:00
|
|
|
src: "{{ nginx_main_template.template_file | default('nginx.conf.j2') }}"
|
|
|
|
dest: "{{ nginx_main_template.conf_file_location | default('/etc/nginx') }}/{{ nginx_main_template.conf_file_name | default('nginx.conf') }}"
|
2018-04-18 02:21:31 +02:00
|
|
|
backup: yes
|
2020-08-28 10:30:23 +02:00
|
|
|
mode: 0644
|
2019-08-07 22:16:27 +02:00
|
|
|
when: nginx_main_template_enable | bool
|
2020-09-15 21:27:06 +02:00
|
|
|
notify: "(Handler) Reload NGINX"
|
2018-02-20 21:28:14 +01:00
|
|
|
|
2020-09-15 21:27:06 +02:00
|
|
|
- name: "(DEPRECATED) Ensure NGINX HTTP Directory Exists"
|
2018-04-05 01:48:31 +02:00
|
|
|
file:
|
2019-05-21 17:23:06 +02:00
|
|
|
path: "{{ item.value.conf_file_location | default('/etc/nginx/conf.d/') }}"
|
2018-04-05 01:48:31 +02:00
|
|
|
state: directory
|
2020-08-28 10:30:23 +02:00
|
|
|
mode: 0755
|
2018-10-16 20:52:04 +02:00
|
|
|
with_dict: "{{ nginx_http_template }}"
|
2019-08-07 22:16:27 +02:00
|
|
|
when: nginx_http_template_enable | bool
|
2018-04-05 01:48:31 +02:00
|
|
|
|
2020-09-15 21:27:06 +02:00
|
|
|
- name: "(DEPRECATED) Ensure NGINX Proxy Cache Directories Exist"
|
2019-02-12 16:12:40 +01:00
|
|
|
file:
|
|
|
|
path: "{{ item.1.path }}"
|
|
|
|
state: directory
|
2019-05-21 17:23:06 +02:00
|
|
|
owner: "{{ nginx_main_template.user | default('nginx') }}"
|
2020-08-28 10:30:23 +02:00
|
|
|
mode: 0755
|
2019-02-12 16:12:40 +01:00
|
|
|
with_subelements:
|
|
|
|
- "{{ nginx_http_template }}"
|
2019-11-26 00:46:03 +01:00
|
|
|
- proxy_cache.proxy_cache_path
|
2020-09-15 21:27:06 +02:00
|
|
|
- skip_missing: yes
|
2019-08-07 22:16:27 +02:00
|
|
|
when: nginx_http_template_enable | bool
|
2019-02-12 16:12:40 +01:00
|
|
|
|
2020-09-15 21:27:06 +02:00
|
|
|
- name: "(DEPRECATED) Dynamically Generate NGINX HTTP Configuration Files"
|
2018-02-20 21:28:14 +01:00
|
|
|
template:
|
2019-05-21 17:23:06 +02:00
|
|
|
src: "{{ item.value.template_file | default('http/default.conf.j2') }}"
|
|
|
|
dest: "{{ item.value.conf_file_location | default('/etc/nginx/conf.d/') }}/{{ item.value.conf_file_name | default('default.conf') }}"
|
2018-04-18 02:21:31 +02:00
|
|
|
backup: yes
|
2020-08-28 10:30:23 +02:00
|
|
|
mode: 0644
|
2018-10-16 20:52:04 +02:00
|
|
|
with_dict: "{{ nginx_http_template }}"
|
2019-08-07 22:16:27 +02:00
|
|
|
when: nginx_http_template_enable | bool
|
2020-09-15 21:27:06 +02:00
|
|
|
notify: "(Handler) Reload NGINX"
|
2018-02-20 21:28:14 +01:00
|
|
|
|
2020-09-15 21:27:06 +02:00
|
|
|
- name: "(DEPRECATED) Dynamically Generate NGINX Stub Status Configuration File"
|
2020-07-22 16:19:43 +02:00
|
|
|
template:
|
|
|
|
src: "{{ nginx_status_template_file | default('http/status.conf.j2') }}"
|
|
|
|
dest: "{{ nginx_status_file_location | default('/etc/nginx/conf.d/status.conf') }}"
|
|
|
|
backup: yes
|
2020-08-28 10:30:23 +02:00
|
|
|
mode: 0644
|
2020-07-22 16:19:43 +02:00
|
|
|
when: nginx_status_enable | bool
|
2020-09-15 21:27:06 +02:00
|
|
|
notify: "(Handler) Reload NGINX"
|
2020-07-22 16:19:43 +02:00
|
|
|
|
2020-09-15 21:27:06 +02:00
|
|
|
- name: "(DEPRECATED) Dynamically Generate NGINX API Configuration File"
|
2019-05-21 17:23:06 +02:00
|
|
|
template:
|
2019-11-18 17:14:00 +01:00
|
|
|
src: "{{ nginx_rest_api_template_file | default('http/api.conf.j2') }}"
|
|
|
|
dest: "{{ nginx_rest_api_file_location | default('/etc/nginx/conf.d/api.conf') }}"
|
2019-05-21 17:23:06 +02:00
|
|
|
backup: yes
|
2020-08-28 10:30:23 +02:00
|
|
|
mode: 0644
|
2019-08-07 22:16:27 +02:00
|
|
|
when: nginx_rest_api_enable | bool
|
2020-09-15 21:27:06 +02:00
|
|
|
notify: "(Handler) Reload NGINX"
|
2019-05-21 17:23:06 +02:00
|
|
|
|
2020-09-15 21:27:06 +02:00
|
|
|
- name: "(DEPRECATED) Ensure NGINX Stream Directory Exists"
|
2018-04-05 01:48:31 +02:00
|
|
|
file:
|
2019-05-21 17:23:06 +02:00
|
|
|
path: "{{ item.value.conf_file_location | default('/etc/nginx/conf.d/stream/') }}"
|
2018-04-05 01:48:31 +02:00
|
|
|
state: directory
|
2020-08-28 10:30:23 +02:00
|
|
|
mode: 0755
|
2019-02-06 13:39:48 +01:00
|
|
|
with_dict: "{{ nginx_stream_template }}"
|
2019-08-07 22:16:27 +02:00
|
|
|
when: nginx_stream_template_enable | bool
|
2018-04-05 01:48:31 +02:00
|
|
|
|
2020-09-15 21:27:06 +02:00
|
|
|
- name: "(DEPRECATED) Dynamically Generate NGINX Stream Configuration Files"
|
2018-02-20 21:28:14 +01:00
|
|
|
template:
|
2019-05-21 17:23:06 +02:00
|
|
|
src: "{{ item.value.template_file | default('stream/default.conf.j2') }}"
|
|
|
|
dest: "{{ item.value.conf_file_location | default('/etc/nginx/conf.d/stream/') }}/{{ item.value.conf_file_name | default('default.conf') }}"
|
2018-04-18 02:21:31 +02:00
|
|
|
backup: yes
|
2020-08-28 10:30:23 +02:00
|
|
|
mode: 0644
|
2019-02-06 13:39:48 +01:00
|
|
|
with_dict: "{{ nginx_stream_template }}"
|
2019-08-07 22:16:27 +02:00
|
|
|
when: nginx_stream_template_enable | bool
|
2020-09-15 21:27:06 +02:00
|
|
|
notify: "(Handler) Reload NGINX"
|