ansible-role-nginx/tasks/prerequisites/prerequisites.yml

20 lines
686 B
YAML
Raw Normal View History

2020-09-15 21:27:06 +02:00
---
2020-09-19 17:32:17 +02:00
- name: Install dependencies
2020-09-15 21:27:06 +02:00
include_tasks: "{{ role_path }}/tasks/prerequisites/install-dependencies.yml"
2020-09-19 17:32:17 +02:00
- name: Set up SELinux
2020-09-15 21:27:06 +02:00
block:
2020-09-19 17:32:17 +02:00
- name: Check if SELinux is enabled
2020-09-15 21:27:06 +02:00
debug:
2020-09-19 17:32:17 +02:00
msg: You need to enable SELinux, if it was disabled you need to reboot
2020-09-15 21:27:06 +02:00
when: ansible_facts['selinux'] is undefined
2020-09-19 17:32:17 +02:00
- name: Configure SELinux
2020-09-15 21:27:06 +02:00
include_tasks: "{{ role_path }}/tasks/prerequisites/setup-selinux.yml"
2020-10-08 12:48:56 +02:00
when: ansible_facts['selinux']['mode'] is defined
2020-09-15 21:27:06 +02:00
when:
- nginx_selinux | bool
2020-10-08 12:48:56 +02:00
- "'selinux' in ansible_facts"
2020-09-15 21:27:06 +02:00
- ansible_facts['os_family'] in ['RedHat', 'Suse']
- ansible_facts['distribution'] not in ['Amazon', 'OracleLinux']