# /usr/sbin/semodule:  Could not connect to policy handler

**URL:** <https://forum.ansible.com/t/usr-sbin-semodule-could-not-connect-to-policy-handler/23912>\
**Category:** Ansible Developer\
**Created:** [March 8, 2017, 3:33pm UTC](https://forum.ansible.com/t/usr-sbin-semodule-could-not-connect-to-policy-handler/23912 "2017-03-08T15:33:39Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Andre\_Meeuwesen\_Busi](https://avatars.discourse-cdn.com/v4/letter/a/96bed5/32.png) [@Andre\_Meeuwesen\_Busi](https://forum.ansible.com/u/Andre_Meeuwesen_Busi)\
**Post date:** [March 8, 2017, 3:33pm UTC](https://forum.ansible.com/t/usr-sbin-semodule-could-not-connect-to-policy-handler/23912/1 "2017-03-08T15:33:39Z")

</div>

Hallo folks,

I am Andre, a newby on Ansible.  
Working en Living in the Netherlands. Linux sysadmin for a long time, but no selinux and ansible master.

I want to import a selinux .pp file with ansible

- name: import nagios\_collect.pp  
command: /usr/sbin/semodule -i {{ tmp\_dir }}/nagios\_collect.pp

stderr": “libsemanage.semanage\_create\_store: Could not access module store at /etc/selinux/targeted, or it is not a directory. (Permission denied).\nlibsemanage.semanage\_direct\_connect: could not establish direct connection (Permission denied).\n/usr/sbin/semodule: Could not connect to policy handler”,

stderr: libsemanage.semanage\_create\_store: Could not access module store at /etc/selinux/targeted, or it is not a directory. (Permission denied).  
libsemanage.semanage\_direct\_connect: could not establish direct connection (Permission denied).  
/usr/sbin/semodule: Could not connect to policy handler

with become\_user=root in the playbook it keeps failing.

Anybody any clue or pointers for me?  
I have the o’reilly book next to me, but found no solutions yet.

Best regards  
Andre
