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

**URL:** <https://forum.ansible.com/t/msg-aborting-target-uses-selinux-but-python-bindings-libselinux-python-arent-installed/16286>\
**Category:** Ansible Project\
**Created:** [September 19, 2014, 12:36pm UTC](https://forum.ansible.com/t/msg-aborting-target-uses-selinux-but-python-bindings-libselinux-python-arent-installed/16286 "2014-09-19T12:36:45Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Zhenkai\_Jiang](https://avatars.discourse-cdn.com/v4/letter/z/71c47a/32.png) [@Zhenkai\_Jiang](https://forum.ansible.com/u/Zhenkai_Jiang)\
**Post date:** [September 19, 2014, 12:36pm UTC](https://forum.ansible.com/t/msg-aborting-target-uses-selinux-but-python-bindings-libselinux-python-arent-installed/16286/1 "2014-09-19T12:36:45Z")

</div>

I was trying to use copy module which rely on libselinux-python when selinux is enabled i think.

The weird thing is I have checked every single environment, they have already have latest libselinux-python installed…

What can I do now?

Much appreciated.

---

<div class="post-metadata">

**Author:** ![Zhenkai\_Jiang](https://avatars.discourse-cdn.com/v4/letter/z/71c47a/32.png) [@Zhenkai\_Jiang](https://forum.ansible.com/u/Zhenkai_Jiang)\
**Post date:** [September 19, 2014, 12:37pm UTC](https://forum.ansible.com/t/msg-aborting-target-uses-selinux-but-python-bindings-libselinux-python-arent-installed/16286/2 "2014-09-19T12:37:43Z")

</div>

some info:

sudo yum install -y libselinux-python  
Loaded plugins: fastestmirror, security  
Loading mirror speeds from cached hostfile

- base: [centos.mirrors.tds.net](http://centos.mirrors.tds.net)
- epel: [mirrors.solfo.com](http://mirrors.solfo.com)
- extras: [mirror.supremebytes.com](http://mirror.supremebytes.com)
- updates: [mirrors.xmission.com](http://mirrors.xmission.com)  
Setting up Install Process  
Package libselinux-python-1.33.4-5.7.el5.x86\_64 already installed and latest version  
Nothing to do

$ ansible --version  
ansible 1.7

---

<div class="post-metadata">

**Author:** ![Dick\_Davies](https://avatars.discourse-cdn.com/v4/letter/d/b9e5f3/32.png) [@Dick\_Davies](https://forum.ansible.com/u/Dick_Davies)\
**Post date:** [September 19, 2014, 4:12pm UTC](https://forum.ansible.com/t/msg-aborting-target-uses-selinux-but-python-bindings-libselinux-python-arent-installed/16286/3 "2014-09-19T16:12:38Z")

</div>

Are you checking on the nodes you're trying to manage, or on the machine  
that has ansible installed?

My guess is you need it on the nodes, so a task above the copy like

- name: install selinux bindings  
&nbsp;&nbsp;yum: name=libselinux-python state=present

will push it out before you need to use it.

---

<div class="post-metadata">

**Author:** ![Zhenkai\_Jiang](https://avatars.discourse-cdn.com/v4/letter/z/71c47a/32.png) [@Zhenkai\_Jiang](https://forum.ansible.com/u/Zhenkai_Jiang)\
**Post date:** [September 22, 2014, 2:15am UTC](https://forum.ansible.com/t/msg-aborting-target-uses-selinux-but-python-bindings-libselinux-python-arent-installed/16286/4 "2014-09-22T02:15:18Z")

</div>

I was checking on the node. and yes, i have tried run playbook like this… But it’s still complaining same error while using copy module.

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan1](https://avatars.discourse-cdn.com/v4/letter/m/5e9695/32.png) [@Michael\_DeHaan1](https://forum.ansible.com/u/Michael_DeHaan1)\
**Post date:** [September 22, 2014, 5:18pm UTC](https://forum.ansible.com/t/msg-aborting-target-uses-selinux-but-python-bindings-libselinux-python-arent-installed/16286/5 "2014-09-22T17:18:20Z")

</div>

The copy module uses the exact same functions for this as other modules.

Could this be a machine where the bindings are yet not installed?

---

<div class="post-metadata">

**Author:** ![satheesh\_kumar](https://avatars.discourse-cdn.com/v4/letter/s/bcef8e/32.png) [@satheesh\_kumar](https://forum.ansible.com/u/satheesh_kumar)\
**Post date:** [April 29, 2015, 4:25pm UTC](https://forum.ansible.com/t/msg-aborting-target-uses-selinux-but-python-bindings-libselinux-python-arent-installed/16286/6 "2015-04-29T16:25:06Z")

</div>

Same issue occured, and your solution solved me. thanks!

---

<div class="post-metadata">

**Author:** ![Joaquin\_Menchaca](https://avatars.discourse-cdn.com/v4/letter/j/d2c977/32.png) [@Joaquin\_Menchaca](https://forum.ansible.com/u/Joaquin_Menchaca)\
**Post date:** [August 14, 2018, 2:03am UTC](https://forum.ansible.com/t/msg-aborting-target-uses-selinux-but-python-bindings-libselinux-python-arent-installed/16286/7 "2018-08-14T02:03:53Z")

</div>

I had this issue Ansible 2.6.2 on Fedora 28 system using Ansible local connection. Doing /usr/bin/dnf install -y libselinux-python fixed it for me. Thanks.

I wonder why Ansible doesn’t install needed prereq?

---

<div class="post-metadata">

**Author:** ![Jonathan\_Lozada\_De\_L](https://avatars.discourse-cdn.com/v4/letter/j/eb8c5e/32.png) [@Jonathan\_Lozada\_De\_L](https://forum.ansible.com/u/Jonathan_Lozada_De_L)\
**Post date:** [August 14, 2018, 2:08am UTC](https://forum.ansible.com/t/msg-aborting-target-uses-selinux-but-python-bindings-libselinux-python-arent-installed/16286/8 "2018-08-14T02:08:49Z")

</div>

My understanding its because not all systems have selinux enabled so having it as a dependency its not a good idea. Although if you run into this issue the output tells you what it needs.
