feat: add test for Rocky Linux 8 #1

Merged
xoxys merged 5 commits from test-rocky8 into master 2022-01-26 21:51:09 +00:00
7 changed files with 31 additions and 3 deletions
Showing only changes of commit fbd630d3eb - Show all commits

View File

@ -1,6 +1,6 @@
---
selinux_packages:
- policycoreutils-python
- policycoreutils-python
selinux_policy: "targeted"
selinux_state: "{{ ansible_selinux.config_mode }}"

View File

@ -9,4 +9,5 @@ testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
def test_selinux_setup(host):
assert host.command.check_output("/usr/sbin/getenforce") == "Enforcing"
assert host.package("libselinux-python").is_installed
assert host.package("policycoreutils-python").is_installed

View File

@ -9,4 +9,5 @@ testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
def test_selinux_setup(host):
assert host.command.check_output("/usr/sbin/getenforce") == "Enforcing"
assert host.package("policycoreutils-python").is_installed
assert host.package("libselinux-python").is_installed
assert host.package("policycoreutils-python-utils").is_installed

View File

@ -1,2 +1,15 @@
---
- import_tasks: setup.yml
- 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
- include_tasks: overwrites.yml
- include_tasks: setup.yml

5
tasks/overwrites.yml Normal file
View File

@ -0,0 +1,5 @@
---
- name: Define selinux_packages
set_fact:
selinux_packages: "{{ __selinux_packages }}"
when: selinux_packages is not defined

4
vars/redhat-7.yml Normal file
View File

@ -0,0 +1,4 @@
---
__selinux_packages:
- libselinux-python
- policycoreutils-python

4
vars/redhat-8.yml Normal file
View File

@ -0,0 +1,4 @@
---
__selinux_packages:
- libselinux-python
- policycoreutils-python-utils