-
Notifications
You must be signed in to change notification settings - Fork 77
/
Copy pathmain.yml
44 lines (38 loc) · 1.7 KB
/
main.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
---
- name: Validate Ansible/Jinja2 version and Ansible collections
ansible.builtin.include_tasks: "{{ role_path }}/tasks/validate/validate.yml"
tags: nginx_config_validate
- name: Set up SELinux
ansible.builtin.include_tasks: "{{ role_path }}/tasks/prerequisites/setup-selinux.yml"
when:
- nginx_config_selinux | bool
- ('selinux' in ansible_facts)
- ansible_facts['selinux']['mode'] is defined
- ansible_facts['os_family'] in ['RedHat', 'Suse']
tags: nginx_config_selinux
- name: Cleanup NGINX config
ansible.builtin.include_tasks: "{{ role_path }}/tasks/config/cleanup-config.yml"
when: nginx_config_cleanup | bool
tags: nginx_config_cleanup
- name: Upload NGINX config
ansible.builtin.include_tasks: "{{ role_path }}/tasks/config/upload-config.yml"
when: nginx_config_upload_enable | bool
or nginx_config_upload_html_enable | bool
or nginx_config_upload_ssl_enable | bool
tags: nginx_config_upload
- name: Create NGINX config
ansible.builtin.include_tasks: "{{ role_path }}/tasks/config/template-config.yml"
when: nginx_config_main_template_enable | bool
or nginx_config_http_template_enable | bool
or nginx_config_stream_template_enable | bool
or nginx_config_status_enable | bool
or nginx_config_rest_api_enable | bool
or nginx_config_html_demo_template_enable | bool
or nginx_config_modules is defined and nginx_config_modules | length > 0
tags: nginx_config_template
- name: Ensure NGINX is running
ansible.builtin.meta: flush_handlers
- name: Debug output
ansible.builtin.include_tasks: "{{ role_path }}/tasks/config/debug-output.yml"
when: nginx_config_debug_output | bool
tags: nginx_config_debug_output