How Do You Fix the Ansible Problem about “libselinux-python”?

Problem scenario
You try to run an Ansible playbook, but you get an error like this: "msg: Aborting target uses selinux but python bindings (libselinux-python) aren't installed!"

You are using a Red Hat derivative of Linux (e.g., Red Hat Enterprise Linux, CentOS or Fedora) and Python 3. What should you do?


Install pip3. If you need assistance, see this posting.

Run this command: sudo pip3 install selinux

Leave a comment

Your email address will not be published. Required fields are marked *