2020-09-15 21:27:06 +02:00
|
|
|
## DEPRECATED -- Use nginxinc.nginx_config role instead (https://github.com/nginxinc/ansible-role-nginx-config)
|
2018-10-16 20:52:04 +02: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 NGINX HTML Directory Exists"
|
2020-08-28 10:30:23 +02:00
|
|
|
file:
|
|
|
|
path: "{{ nginx_html_upload_dest | default('/usr/share/nginx/html') }}"
|
|
|
|
state: directory
|
|
|
|
mode: 0755
|
|
|
|
when: nginx_html_upload_enable | bool
|
|
|
|
|
2020-09-15 21:27:06 +02:00
|
|
|
- name: "(DEPRECATED) Upload NGINX HTML Files"
|
2020-08-28 10:30:23 +02:00
|
|
|
copy:
|
|
|
|
src: "{{ item }}"
|
|
|
|
dest: "{{ nginx_html_upload_dest | default('/usr/share/nginx/html') }}"
|
|
|
|
backup: yes
|
|
|
|
mode: 0644
|
|
|
|
with_fileglob: "{{ nginx_html_upload_src }}"
|
|
|
|
when: nginx_html_upload_enable | bool
|
2020-09-15 21:27:06 +02:00
|
|
|
notify: "(Handler) Reload NGINX"
|
2020-08-28 10:30:23 +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_upload_dest | 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_upload_enable | bool
|
2019-05-21 17:23:06 +02:00
|
|
|
|
2020-09-15 21:27:06 +02:00
|
|
|
- name: "(DEPRECATED) Upload NGINX Main Configuration File"
|
2018-10-16 20:52:04 +02:00
|
|
|
copy:
|
2019-05-21 17:23:06 +02:00
|
|
|
src: "{{ nginx_main_upload_src | default('conf/nginx.conf') }}"
|
|
|
|
dest: "{{ nginx_main_upload_dest | default('/etc/nginx/') }}"
|
2018-10-16 20:52:04 +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_upload_enable | bool
|
2020-09-15 21:27:06 +02:00
|
|
|
notify: "(Handler) Reload NGINX"
|
2018-10-16 20:52:04 +02:00
|
|
|
|
2020-09-15 21:27:06 +02:00
|
|
|
- name: "(DEPRECATED) Ensure NGINX HTTP Directory Exists"
|
2018-10-16 20:52:04 +02:00
|
|
|
file:
|
2019-05-21 17:23:06 +02:00
|
|
|
path: "{{ nginx_http_upload_dest | default('/etc/nginx/conf.d/') }}"
|
2018-10-16 20:52:04 +02:00
|
|
|
state: directory
|
2020-08-28 10:30:23 +02:00
|
|
|
mode: 0755
|
2019-08-07 22:16:27 +02:00
|
|
|
when: nginx_http_upload_enable | bool
|
2018-10-16 20:52:04 +02:00
|
|
|
|
2020-09-15 21:27:06 +02:00
|
|
|
- name: "(DEPRECATED) Upload NGINX HTTP Configuration Files"
|
2018-10-16 20:52:04 +02:00
|
|
|
copy:
|
|
|
|
src: "{{ item }}"
|
2019-05-21 17:23:06 +02:00
|
|
|
dest: "{{ nginx_http_upload_dest | default('/etc/nginx/conf.d/') }}"
|
2018-10-16 20:52:04 +02:00
|
|
|
backup: yes
|
2020-08-28 10:30:23 +02:00
|
|
|
mode: 0644
|
2018-10-16 20:52:04 +02:00
|
|
|
with_fileglob: "{{ nginx_http_upload_src }}"
|
2019-08-07 22:16:27 +02:00
|
|
|
when: nginx_http_upload_enable | bool
|
2020-09-15 21:27:06 +02:00
|
|
|
notify: "(Handler) Reload NGINX"
|
2018-10-16 20:52:04 +02:00
|
|
|
|
2020-09-15 21:27:06 +02:00
|
|
|
- name: "(DEPRECATED) Ensure NGINX Stream Directory Exists"
|
2018-10-16 20:52:04 +02:00
|
|
|
file:
|
2019-05-21 17:23:06 +02:00
|
|
|
path: "{{ nginx_stream_upload_dest | default('/etc/nginx/conf.d/') }}"
|
2018-10-16 20:52:04 +02:00
|
|
|
state: directory
|
2020-08-28 10:30:23 +02:00
|
|
|
mode: 0755
|
2019-08-07 22:16:27 +02:00
|
|
|
when: nginx_stream_upload_enable | bool
|
2018-10-16 20:52:04 +02:00
|
|
|
|
2020-09-15 21:27:06 +02:00
|
|
|
- name: "(DEPRECATED) Upload NGINX Stream Configuration Files"
|
2018-10-16 20:52:04 +02:00
|
|
|
copy:
|
|
|
|
src: "{{ item }}"
|
2019-05-21 17:23:06 +02:00
|
|
|
dest: "{{ nginx_stream_upload_dest | default('/etc/nginx/conf.d/') }}"
|
2018-10-16 20:52:04 +02:00
|
|
|
backup: yes
|
2020-08-28 10:30:23 +02:00
|
|
|
mode: 0644
|
2018-10-16 20:52:04 +02:00
|
|
|
with_fileglob: "{{ nginx_stream_upload_src }}"
|
2019-08-07 22:16:27 +02:00
|
|
|
when: nginx_stream_upload_enable | bool
|
2020-09-15 21:27:06 +02:00
|
|
|
notify: "(Handler) Reload NGINX"
|
2018-10-16 20:52:04 +02:00
|
|
|
|
2020-09-15 21:27:06 +02:00
|
|
|
- name: "(DEPRECATED) Ensure SSL Certificate Directory Exists"
|
2018-10-16 20:52:04 +02:00
|
|
|
file:
|
2019-05-21 17:23:06 +02:00
|
|
|
path: "{{ nginx_ssl_crt_upload_dest | default('/etc/ssl/certs/') }}"
|
2018-10-16 20:52:04 +02:00
|
|
|
state: directory
|
2020-08-28 10:30:23 +02:00
|
|
|
mode: 0755
|
2019-08-07 22:16:27 +02:00
|
|
|
when: nginx_ssl_upload_enable | bool
|
2018-10-16 20:52:04 +02:00
|
|
|
|
2020-09-15 21:27:06 +02:00
|
|
|
- name: "(DEPRECATED) Ensure SSL Key Directory Exists"
|
2018-10-16 20:52:04 +02:00
|
|
|
file:
|
2019-05-21 17:23:06 +02:00
|
|
|
path: "{{ nginx_ssl_key_upload_dest | default('/etc/ssl/private/') }}"
|
2018-10-16 20:52:04 +02:00
|
|
|
state: directory
|
2020-08-28 10:30:23 +02:00
|
|
|
mode: 0755
|
2019-08-07 22:16:27 +02:00
|
|
|
when: nginx_ssl_upload_enable | bool
|
2018-10-16 20:52:04 +02:00
|
|
|
|
2020-09-15 21:27:06 +02:00
|
|
|
- name: "(DEPRECATED) Upload NGINX SSL Certificates"
|
2018-10-16 20:52:04 +02:00
|
|
|
copy:
|
|
|
|
src: "{{ item }}"
|
2019-05-21 17:23:06 +02:00
|
|
|
dest: "{{ nginx_ssl_crt_upload_dest | default('/etc/ssl/certs/') }}"
|
2019-02-01 19:59:56 +01:00
|
|
|
decrypt: yes
|
2018-10-16 20:52:04 +02:00
|
|
|
backup: yes
|
2020-08-28 10:30:23 +02:00
|
|
|
mode: 0640
|
2018-10-16 20:52:04 +02:00
|
|
|
with_fileglob: "{{ nginx_ssl_crt_upload_src }}"
|
2019-08-07 22:16:27 +02:00
|
|
|
when: nginx_ssl_upload_enable | bool
|
2018-10-16 20:52:04 +02:00
|
|
|
|
2020-09-15 21:27:06 +02:00
|
|
|
- name: "(DEPRECATED) Upload NGINX SSL Keys"
|
2018-10-16 20:52:04 +02:00
|
|
|
copy:
|
|
|
|
src: "{{ item }}"
|
2019-05-21 17:23:06 +02:00
|
|
|
dest: "{{ nginx_ssl_key_upload_dest | default('/etc/ssl/private/') }}"
|
2019-02-01 19:59:56 +01:00
|
|
|
decrypt: yes
|
2018-10-16 20:52:04 +02:00
|
|
|
backup: yes
|
2020-08-28 10:30:23 +02:00
|
|
|
mode: 0640
|
2018-10-16 20:52:04 +02:00
|
|
|
with_fileglob: "{{ nginx_ssl_key_upload_src }}"
|
2020-04-22 14:59:07 +02:00
|
|
|
no_log: yes
|
2019-08-07 22:16:27 +02:00
|
|
|
when: nginx_ssl_upload_enable | bool
|