ansible is failed for some of the servers while performing user add task

Manish Sawant asked:

below is the error :

FAILED! => {"ansible_facts": {"discovered_interpreter_pyt hon": "/usr/bin/python"}, "changed": false, "checksum": "2ca063f74f5a03d16fb6db0 dba613f2ec60f97b2", "msg": "Aborting, target uses selinux but python bindings (l ibselinux-python) aren’t installed!"}

My answer:

You need to install the indicated package on the target host before trying to manipulate user accounts.

On old RHEL/CentOS 7 systems you should install libselinux-python. On modern systems such as RHEL 8 and Fedora it is named python3-libselinux.

View the full question and any other answers on Server Fault.

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.