35 lines
990 B
YAML
35 lines
990 B
YAML
---
|
|
- name: Include OS specific vars
|
|
ansible.builtin.include_vars: "{{ var_files }}"
|
|
vars:
|
|
var_files: "{{ lookup('first_found', params, errors='ignore') }}"
|
|
params:
|
|
files:
|
|
- "{{ ansible_lsb.id | default('') | lower }}.yml"
|
|
- "{{ ansible_os_family | lower }}-{{ ansible_distribution_major_version }}.yml"
|
|
- "{{ ansible_os_family | lower }}.yml"
|
|
paths:
|
|
- "vars"
|
|
when: var_files
|
|
|
|
- name: Define selinux_packages
|
|
ansible.builtin.set_fact:
|
|
selinux_packages: "{{ __selinux_packages }}"
|
|
when: selinux_packages is not defined
|
|
|
|
- name: Set current selinux policy
|
|
ansible.builtin.set_fact:
|
|
selinux_current: "{{ ansible_selinux.config_mode }}"
|
|
|
|
- name: Install dependencies
|
|
ansible.builtin.package:
|
|
name: "{{ item }}"
|
|
state: present
|
|
loop: "{{ selinux_packages }}"
|
|
|
|
- name: Set selinux policy
|
|
ansible.posix.selinux:
|
|
policy: "{{ selinux_policy }}"
|
|
state: "{{ selinux_state }}"
|
|
notify: __selinux_autorelabel
|