Fix ansible core 2.20 and supported OS list

Signed-off-by: Jason Rothstein <fdragon@fdragon.org>
This commit is contained in:
2026-05-05 14:10:43 -05:00
parent 9779d19380
commit 17b4f96aca
13 changed files with 51 additions and 15 deletions
+15 -15
View File
@@ -2,18 +2,18 @@
# tasks file for ensure_selinux # tasks file for ensure_selinux
- name: 'include variables' - name: 'include variables'
when: when:
- ansible_system == 'Linux' - ansible_facts["system"] == 'Linux'
include_vars: include_vars:
file: '{{ lookup("first_found", findme ) }}' file: '{{ lookup("first_found", findme ) }}'
name: 'ensure_selinux' name: 'ensure_selinux'
vars: vars:
findme: findme:
files: files:
- '{{ ansible_distribution }}-{{ ansible_distribution_major_version }}-{{ ansible_architecture }}.yml' - '{{ ansible_facts["distribution"] }}-{{ ansible_facts["distribution_major_version"] }}-{{ ansible_architecture }}.yml'
- '{{ ansible_distribution }}-{{ ansible_distribution_major_version }}-default.yml' - '{{ ansible_facts["distribution"] }}-{{ ansible_facts["distribution_major_version"] }}-default.yml'
- '{{ ansible_distribution }}-default.yml' - '{{ ansible_facts["distribution"] }}-default.yml'
- '{{ ansible_os_family }}-{{ ansible_distribution_major_version }}-{{ ansible_architecture }}.yml' - '{{ ansible_os_family }}-{{ ansible_facts["distribution_major_version"] }}-{{ ansible_architecture }}.yml'
- '{{ ansible_os_family }}-{{ ansible_distribution_major_version }}-default.yml' - '{{ ansible_os_family }}-{{ ansible_facts["distribution_major_version"] }}-default.yml'
- '{{ ansible_os_family }}-default.yml' - '{{ ansible_os_family }}-default.yml'
- 'default.yml' - 'default.yml'
paths: paths:
@@ -21,17 +21,17 @@
errors: 'ignore' errors: 'ignore'
- name: 'package discovery' - name: 'package discovery'
when: when:
- ansible_system == 'Linux' - ansible_facts["system"] == 'Linux'
- packages is not defined - ansible_facts["packages"] is not defined
ansible.builtin.package_facts: ansible.builtin.package_facts:
- name: 'service discovery' - name: 'service discovery'
when: when:
- ansible_system == 'Linux' - ansible_facts["system"] == 'Linux'
- services is not defined - services is not defined
ansible.builtin.service_facts: ansible.builtin.service_facts:
- name: 'ensure packages' - name: 'ensure packages'
when: when:
- ansible_system == 'Linux' - ansible_facts["system"] == 'Linux'
- ensure_selinux is defined - ensure_selinux is defined
- ensure_selinux.package_list is defined - ensure_selinux.package_list is defined
- ensure_selinux.package_list is iterable - ensure_selinux.package_list is iterable
@@ -46,7 +46,7 @@
- 'ensure_selinux.service_facts' - 'ensure_selinux.service_facts'
- name: 'ensure configurations' - name: 'ensure configurations'
when: when:
- ansible_system == 'Linux' - ansible_facts["system"] == 'Linux'
- ensure_selinux is defined - ensure_selinux is defined
- ensure_selinux.template_list is defined - ensure_selinux.template_list is defined
- ensure_selinux.template_list is iterable - ensure_selinux.template_list is iterable
@@ -71,7 +71,7 @@
- 'ensure_selinux.service_restart' - 'ensure_selinux.service_restart'
- name: 'ensure services' - name: 'ensure services'
when: when:
- ansible_system == 'Linux' - ansible_facts["system"] == 'Linux'
- ensure_selinux is defined - ensure_selinux is defined
- ensure_selinux.service_list is defined - ensure_selinux.service_list is defined
- ensure_selinux.service_list is iterable - ensure_selinux.service_list is iterable
@@ -87,7 +87,7 @@
- 'ensure_selinux.service_facts' - 'ensure_selinux.service_facts'
- name: 'Ensure SELinux is configured' - name: 'Ensure SELinux is configured'
when: when:
- ansible_system == 'Linux' - ansible_facts["system"] == 'Linux'
- ensure_selinux is defined - ensure_selinux is defined
- ensure_selinux.selinux_policy is defined - ensure_selinux.selinux_policy is defined
- ensure_selinux.selinux_state is defined - ensure_selinux.selinux_state is defined
@@ -97,7 +97,7 @@
register: 'results' register: 'results'
- name: 'Reboot if required' - name: 'Reboot if required'
when: when:
- ansible_system == 'Linux' - ansible_facts["system"] == 'Linux'
- ensure_selinux is defined - ensure_selinux is defined
- ensure_selinux.selinux_policy is defined - ensure_selinux.selinux_policy is defined
- ensure_selinux.selinux_state is defined - ensure_selinux.selinux_state is defined
@@ -107,7 +107,7 @@
reboot: reboot:
- name: 'ensure seboolean' - name: 'ensure seboolean'
when: when:
- ansible_system == 'Linux' - ansible_facts["system"] == 'Linux'
- ensure_selinux is defined - ensure_selinux is defined
- ensure_selinux.seboolean_list is defined - ensure_selinux.seboolean_list is defined
- ensure_selinux.seboolean_list is iterable - ensure_selinux.seboolean_list is iterable
+9
View File
@@ -0,0 +1,9 @@
---
# vars file for ensure_selinux
package_list:
- name: 'python3-libselinux'
state: 'present'
- name: 'python3-libsemanage'
state: 'present'
selinux_policy: 'targeted'
selinux_state: 'enforcing'
+9
View File
@@ -0,0 +1,9 @@
---
# vars file for ensure_selinux
package_list:
- name: 'python3-libselinux'
state: 'present'
- name: 'python3-libsemanage'
state: 'present'
selinux_policy: 'targeted'
selinux_state: 'enforcing'
+9
View File
@@ -0,0 +1,9 @@
---
# vars file for ensure_selinux
package_list:
- name: 'python3-libselinux'
state: 'present'
- name: 'python3-libsemanage'
state: 'present'
selinux_policy: 'targeted'
selinux_state: 'enforcing'
+9
View File
@@ -0,0 +1,9 @@
---
# vars file for ensure_selinux
package_list:
- name: 'python3-libselinux'
state: 'present'
- name: 'python3-libsemanage'
state: 'present'
selinux_policy: 'targeted'
selinux_state: 'enforcing'