Question:
I am trying to run Ansible playbook command and getting an error as below.
123 fatal: [localhost]: FAILED! => {"changed": false, "msg": "Aborting, targetuses selinux but python bindings (libselinux-python) aren't installed!"}
When I checked for libselinux-python, it showsit is already available.
1 2 3 |
[root@host all]# sudo yum list installed |grep libselinux-python libselinux-python3.x86_64 2.5-15.el7 @rhel-7-server-rpms |
Please provide your input if anyone has faced and resolved this.
Below are my Python and Ansible versions installed on server.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
[root@ xxx bin]# python --version Python 3.6.5 [root@xxx bin]# which python /root/.pyenv/shims/python [root@xxx bin]# ansible --version ansible 2.9.9 config file = /etc/ansible/ansible.cfg configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules'] ansible python module location = /root/.pyenv/versions/3.6.5/lib/python3.6/site-packages/ansible executable location = /root/.pyenv/versions/3.6.5/bin/ansible python version = 3.6.5 (default, Jun 18 2020, 17:32:20) [GCC 4.8.5 20150623 (Red Hat 4.8.5-39)] [root@ xxx bin]# |
Answer:
I’ve just lost a whole day to this and I managed to solve it running sudo yum install libselinux-python3