It appears as though you are using an SCL python:

/opt/rh/python27/root/usr/bin/python2

The libselinux-python package is not available to the SCL, and selinux
python bindings are not provided for SCLs.

On Fri, Aug 7, 2020 at 5:43 PM Nagesh sheregar <[email protected]> wrote:

> Hi Team,
>
> i am getting bellow error:
>
> i can see libselinux-python installed but  i am getting below error not
> sure why
>
> [root@s605141sl7vl402 ansible]# rpm -qa | grep libselinux-python
> libselinux-python-2.5-15.el7.x86_64
> [root@s605141sl7vl402 ansible]#
>
>
>
> TASK [firmware : connect the VC]
> ************************************************************************************************************************************************************************************************************
> task path: /data01/ansible/playbooks/roles/firmware/tasks/nic.yml:2
> <127.0.0.1> ESTABLISH LOCAL CONNECTION FOR USER: root
> <127.0.0.1> EXEC /bin/sh -c 'echo ~root && sleep 0'
> <127.0.0.1> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo
> /root/.ansible/tmp `"&& mkdir
> /root/.ansible/tmp/ansible-tmp-1596839965.56-8623-255860923309448 && echo
> ansible-tmp-1596839965.56-8623-255860923309448="` echo
> /root/.ansible/tmp/ansible-tmp-1596839965.56-8623-255860923309448 `" ) &&
> sleep 0'
> <127.0.0.1> EXEC /bin/sh -c 'echo ~root && sleep 0'
> Using module file
> /usr/lib/python2.7/site-packages/ansible/modules/files/stat.py
> <127.0.0.1> PUT /root/.ansible/tmp/ansible-local-8543Bm9eWG/tmpeIAjnY TO
> /root/.ansible/tmp/ansible-tmp-1596839965.56-8623-255860923309448/AnsiballZ_stat.py
> <127.0.0.1> EXEC /bin/sh -c 'chmod u+x
> /root/.ansible/tmp/ansible-tmp-1596839965.56-8623-255860923309448/
> /root/.ansible/tmp/ansible-tmp-1596839965.56-8623-255860923309448/AnsiballZ_stat.py
> && sleep 0'
> <127.0.0.1> EXEC /bin/sh -c '/opt/rh/python27/root/usr/bin/python2
> /root/.ansible/tmp/ansible-tmp-1596839965.56-8623-255860923309448/AnsiballZ_stat.py
> && sleep 0'
> <127.0.0.1> PUT
> /root/.ansible/tmp/ansible-local-8543Bm9eWG/tmpvSF4kk/nic.ps1.j2 TO
> /root/.ansible/tmp/ansible-tmp-1596839965.56-8623-255860923309448/source
> <127.0.0.1> EXEC /bin/sh -c 'chmod u+x
> /root/.ansible/tmp/ansible-tmp-1596839965.56-8623-255860923309448/
> /root/.ansible/tmp/ansible-tmp-1596839965.56-8623-255860923309448/source &&
> sleep 0'
> Using module file
> /usr/lib/python2.7/site-packages/ansible/modules/files/copy.py
> <127.0.0.1> PUT /root/.ansible/tmp/ansible-local-8543Bm9eWG/tmpn4OyUE TO
> /root/.ansible/tmp/ansible-tmp-1596839965.56-8623-255860923309448/AnsiballZ_copy.py
> <127.0.0.1> EXEC /bin/sh -c 'chmod u+x
> /root/.ansible/tmp/ansible-tmp-1596839965.56-8623-255860923309448/
> /root/.ansible/tmp/ansible-tmp-1596839965.56-8623-255860923309448/AnsiballZ_copy.py
> && sleep 0'
> <127.0.0.1> EXEC /bin/sh -c '/opt/rh/python27/root/usr/bin/python2
> /root/.ansible/tmp/ansible-tmp-1596839965.56-8623-255860923309448/AnsiballZ_copy.py
> && sleep 0'
> <127.0.0.1> EXEC /bin/sh -c 'rm -f -r
> /root/.ansible/tmp/ansible-tmp-1596839965.56-8623-255860923309448/ >
> /dev/null 2>&1 && sleep 0'
> fatal: [localhost]: FAILED! => {
>     "changed": false,
>     "checksum": "1f4ebaebaf1be3adbe5f2c2c9b4bf1bf84c9ce9a",
>     "diff": [],
>     "invocation": {
>         "module_args": {
>             "_original_basename": "nic.ps1.j2",
>             "attributes": null,
>             "backup": false,
>             "checksum": "1f4ebaebaf1be3adbe5f2c2c9b4bf1bf84c9ce9a",
>             "content": null,
>             "delimiter": null,
>             "dest": "/root/script.ps1",
>             "directory_mode": null,
>             "follow": false,
>             "force": true,
>             "group": null,
>             "local_follow": null,
>             "mode": null,
>             "owner": null,
>             "regexp": null,
>             "remote_src": null,
>             "selevel": null,
>             "serole": null,
>             "setype": null,
>             "seuser": null,
>             "src":
> "/root/.ansible/tmp/ansible-tmp-1596839965.56-8623-255860923309448/source",
>             "unsafe_writes": null,
>             "validate": null
>         }
>     },
>     "msg": "Aborting, target uses selinux but python bindings
> (libselinux-python) aren't installed!"
> }
>
> --
> You received this message because you are subscribed to the Google Groups
> "Ansible Project" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/f1df341f-2a7a-4f44-9280-690aea5533d0o%40googlegroups.com
> <https://groups.google.com/d/msgid/ansible-project/f1df341f-2a7a-4f44-9280-690aea5533d0o%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
-- 
Matt Martz
@sivel
sivel.net

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAD8N0v_U_mThydOu%2B9w%3DSMLCZRrHfXAFL23m0KAArfYD35fq0w%40mail.gmail.com.

Reply via email to