2018-01-10 23:40:01 +01:00
|
|
|
---
|
2020-07-22 16:19:43 +02:00
|
|
|
- name: "(Setup: All OSs) Setup Prerequisites"
|
2020-06-30 18:59:53 +02:00
|
|
|
include_tasks: "{{ role_path }}/tasks/prerequisites/setup-{{ ansible_os_family | lower }}.yml"
|
2019-11-19 15:47:29 +01:00
|
|
|
tags: nginx_prerequisites
|
2018-08-03 00:56:25 +02:00
|
|
|
|
2020-07-22 16:19:43 +02:00
|
|
|
- name: "(Setup: All OSs) Setup Keys"
|
2020-06-30 18:59:53 +02:00
|
|
|
import_tasks: keys/setup-keys.yml
|
2018-10-18 08:26:29 +02:00
|
|
|
when:
|
2020-06-30 18:59:53 +02:00
|
|
|
- ansible_os_family == "Alpine"
|
|
|
|
or ansible_os_family == "Debian"
|
|
|
|
or ansible_os_family == "RedHat"
|
2018-12-21 15:17:00 +01:00
|
|
|
or ansible_os_family == "Suse"
|
|
|
|
- nginx_install_from == "nginx_repository"
|
|
|
|
or nginx_amplify_enable
|
|
|
|
or nginx_unit_enable
|
2020-06-30 18:59:53 +02:00
|
|
|
tags: nginx_key
|
2019-05-20 18:32:08 +02:00
|
|
|
|
2020-07-22 16:19:43 +02:00
|
|
|
- name: "(Install/Config: All OSs) Install and Configure NGINX"
|
2018-07-12 00:41:10 +02:00
|
|
|
block:
|
2020-07-22 16:19:43 +02:00
|
|
|
- name: "(Install: All OSs) Install NGINX"
|
|
|
|
block:
|
|
|
|
- name: "(Install: All OSs) Install NGINX Open Source"
|
|
|
|
include_tasks: "{{ role_path }}/tasks/opensource/install-oss.yml"
|
2020-07-13 18:05:03 +02:00
|
|
|
when: nginx_type == "opensource"
|
|
|
|
tags: nginx_install_oss
|
|
|
|
|
2020-07-22 16:19:43 +02:00
|
|
|
- name: "(Install: All OSs) Install NGINX Plus"
|
|
|
|
include_tasks: "{{ role_path }}/tasks/plus/install-plus.yml"
|
2020-07-13 18:05:03 +02:00
|
|
|
when: nginx_type == "plus"
|
|
|
|
tags: nginx_install_plus
|
|
|
|
|
2020-07-22 16:19:43 +02:00
|
|
|
- name: "(Install: All OSs) Install NGINX Modules"
|
|
|
|
include_tasks: "{{ role_path }}/tasks/modules/install-modules.yml"
|
2020-07-13 18:05:03 +02:00
|
|
|
when: true in nginx_modules.values()
|
|
|
|
tags: nginx_install_modules
|
|
|
|
|
2020-07-22 16:19:43 +02:00
|
|
|
- name: "(Install: All OSs) Delete NGINX Plus License"
|
|
|
|
include_tasks: "{{ role_path }}/tasks/plus/delete-license.yml"
|
2020-07-13 18:05:03 +02:00
|
|
|
when:
|
|
|
|
- nginx_type == "plus"
|
|
|
|
- nginx_delete_license
|
|
|
|
tags: nginx_delete_license
|
|
|
|
when: nginx_install | bool
|
|
|
|
|
2020-07-22 16:19:43 +02:00
|
|
|
- name: "(Config: All OSs) Configure NGINX"
|
|
|
|
block:
|
|
|
|
- name: "(Config: All OSs) Cleanup NGINX Config"
|
|
|
|
include_tasks: "{{ role_path }}/tasks/conf/cleanup-config.yml"
|
2020-07-13 18:05:03 +02:00
|
|
|
when: nginx_cleanup_config | bool
|
|
|
|
tags: nginx_cleanup_config
|
|
|
|
|
2020-07-22 16:19:43 +02:00
|
|
|
- name: "(Config: All OSs) Upload NGINX Config"
|
|
|
|
include_tasks: "{{ role_path }}/tasks/conf/upload-config.yml"
|
2020-07-13 18:05:03 +02:00
|
|
|
when: nginx_main_upload_enable
|
|
|
|
or nginx_http_upload_enable
|
|
|
|
or nginx_stream_upload_enable
|
|
|
|
or nginx_html_upload_enable
|
|
|
|
or nginx_ssl_upload_enable
|
|
|
|
tags: nginx_upload_config
|
|
|
|
|
2020-07-22 16:19:43 +02:00
|
|
|
- name: "(Config: All OSs) Create NGINX Config"
|
|
|
|
include_tasks: "{{ role_path }}/tasks/conf/template-config.yml"
|
2020-07-13 18:05:03 +02:00
|
|
|
when: nginx_main_template_enable
|
|
|
|
or nginx_http_template_enable
|
|
|
|
or nginx_stream_template_enable
|
|
|
|
or nginx_rest_api_enable
|
|
|
|
tags: nginx_template_config
|
|
|
|
when: nginx_configure | bool
|
2019-10-03 18:10:51 +02:00
|
|
|
|
2020-07-07 10:44:13 +02:00
|
|
|
- name: "(Config: All OSs) Ensure NGINX is Running"
|
|
|
|
meta: flush_handlers
|
|
|
|
|
2020-07-22 16:19:43 +02:00
|
|
|
- name: "(Config: All OSs) Debug Output"
|
|
|
|
include_tasks: "{{ role_path }}/tasks/conf/debug-output.yml"
|
2020-07-07 10:44:13 +02:00
|
|
|
when: nginx_debug_output | bool
|
|
|
|
tags: nginx_debug_output
|
|
|
|
|
2020-07-22 16:19:43 +02:00
|
|
|
- name: "(Config: All OSs): Configure Logrotate"
|
|
|
|
include_tasks: "{{ role_path }}/tasks/conf/logrotate.yml"
|
2020-07-07 10:44:13 +02:00
|
|
|
when: nginx_logrotate_conf_enable | bool
|
|
|
|
tags: nginx_logrotate_config
|
2019-05-20 18:32:08 +02:00
|
|
|
when: nginx_enable | bool
|
2018-04-09 23:21:38 +02:00
|
|
|
|
2020-07-22 16:19:43 +02:00
|
|
|
- name: "(Install: All OSs) Install NGINX Amplify"
|
|
|
|
include_tasks: "{{ role_path }}/tasks/amplify/install-amplify.yml"
|
2018-12-21 15:17:00 +01:00
|
|
|
when:
|
2019-05-20 18:32:08 +02:00
|
|
|
- nginx_amplify_enable | bool
|
2018-12-21 15:17:00 +01:00
|
|
|
- nginx_amplify_api_key is defined
|
2019-04-08 15:27:36 +02:00
|
|
|
- nginx_amplify_api_key | length > 0
|
2019-11-19 15:47:29 +01:00
|
|
|
tags: nginx_install_amplify
|
2018-09-11 01:05:25 +02:00
|
|
|
|
2020-07-22 16:19:43 +02:00
|
|
|
- name: "(Install: All OSs) Install NGINX Unit"
|
|
|
|
include_tasks: "{{ role_path }}/tasks/unit/install-unit.yml"
|
2019-05-20 18:32:08 +02:00
|
|
|
when: nginx_unit_enable | bool
|
2019-11-19 15:47:29 +01:00
|
|
|
tags: nginx_install_unit
|