Bug 1932650

Summary: add python38-libselinux
Product: Red Hat Enterprise Linux 8 Reporter: Lark Gordon <lagordon>
Component: distributionAssignee: Tomas Orsava <torsava>
Status: CLOSED WONTFIX QA Contact: Release Test Team <release-test-team-automation>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 8.4CC: cstratak, frush, jens.viebig, jwboyer, list, mark.faine, maxwell, python-maint, torsava
Target Milestone: rcFlags: pm-rhel: mirror+
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-03-31 10:29:26 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Lark Gordon 2021-02-24 20:29:48 UTC
Description of problem:
There's no python38-libselinux package for RHEL 8, which causes some applications to fail when python38 is used.

For example, when I install python38 and attempt to use Ansible modules, I get this error: 

"Aborting, target uses selinux but python bindings (libselinux-python) aren't installed!"

How reproducible:

100%; customer portal package search confirms there's no python38-libselinux package available.

Actual results:
No python38-libselinux package is available

Expected results:
Should have libselinux functionality for python38

Comment 1 Tomas Orsava 2021-02-25 16:02:49 UTC
Hi Lark,
I see that the customer "want[s] to use the latest python and still be able to use selinux enforcing."

Selinux enforcing works with Python 3.8 already. A python38-libselinux package is not necessary for selinux enforcing to work.

The python3-libselinux package that we provide contains Python 3.6 SELinux bindings for developing SELinux applications.
Is is not feasible to ship the libselinux Python bindings for other alternative Python stacks, so we don't provide python38-libselinux.

We recommend to use Python 3.6 or Platform-Python to run Ansible.

https://www.ansible.com/blog/integrating-ansible-and-red-hat-enterprise-linux-8-beta

Comment 5 Mark Faine 2022-04-25 19:04:32 UTC
As someone who has to deal with these issues all the time and has been working to resolve this issue for a while, after so much searching, this is a very disappointing response.

Comment 6 Jens Viebig 2022-05-31 07:13:33 UTC
Now that ansible-core in RHEL 8.6 depends on python38 and sets it as the default python binary, I think this bug should be reopened and a solution reconsidered

Comment 7 frush 2022-06-02 17:26:23 UTC
Let me second the call that this bug should be reopened.   Ansible-core 2.12.2 on EL 8.6 requires python 3.8, and therefore a python38-libselinux

#  ansible --version
ansible [core 2.12.2]
  config file = /etc/ansible/ansible.cfg
  configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python3.8/site-packages/ansible
  ansible collection location = /root/.ansible/collections:/usr/share/ansible/collections
  executable location = /bin/ansible
  python version = 3.8.12 (default, Apr  5 2022, 08:07:47) [GCC 8.5.0 20210514 (Red Hat 8.5.0-10.0.1)]
  jinja version = 2.10.3
  libyaml = True

Example error:

TASK [ Set SELINUX Boolean ]
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: ModuleNotFoundError: No module named 'selinux'
fatal: [isxxt003.is.colostate.edu]: FAILED! => {"changed": false, "msg": "Failed to import the required Python library (libselinux-python) on hostnames's Python /usr/bin/python3.8. Please read the module documentation and install it in the appropriate location. If the required library is installed, but Ansible is using the wrong Python interpreter, please consult the documentation on ansible_python_interpreter"}


Lack of this library will be a breaking change to ansible on hosts that are updated from 2.9 to 5.4.

Comment 8 Miro HronĨok 2022-06-03 10:00:33 UTC
We regularly triage new bugzillas but we don't go over the closed ones. If you have a new problem/request, open a new bugzilla, please.

Comment 9 Harald Gutmann 2022-06-04 15:01:50 UTC
Stumbled on same issue, opened a new ticket:
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=2093589

Comment 10 frush 2022-06-13 14:26:08 UTC
I also opened a new ticket:
https://bugzilla.redhat.com/show_bug.cgi?id=2093105