--- - name: Install mandatory SELinux packages ansible.builtin.package: name: policycoreutils-python state: installed when: ansible_distribution_major_version|int <= 7 - name: Install mandatory SELinux packages ansible.builtin.package: name: policycoreutils-python-utils state: installed when: ansible_distribution_major_version|int >= 8 - name: Create SELinux module directory ansible.builtin.file: dest: /usr/local/share/selinux state: directory mode: 0755 owner: root group: "{{ ansible_wheel }}"