本文介绍了中止,目标使用 selinux 但未安装 Python 绑定 (libselinux-Python)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试运行 Ansible playbook 命令并收到如下错误.
fatal: [localhost]: 失败!=>{已更改":false,msg":正在中止,目标使用 selinux,但未安装 python 绑定(libselinux-python)!"}
当我检查 libselinux-python 时,它显示它已经可用.
[root@host all]# sudo yum list installed |grep libselinux-pythonlibselinux-python3.x86_64 2.5-15.el7 @rhel-7-server-rpms
如果有人遇到并解决了这个问题,请提供您的意见.
以下是我在服务器上安装的 Python 和 Ansible 版本.
[root@xxx bin]# python --version蟒蛇 3.6.5[root@xxx bin]# which python/root/.pyenv/shims/python[root@xxx bin]# ansible --version安全的 2.9.9配置文件 =/etc/ansible/ansible.cfg配置的模块搜索路径 = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']ansible python 模块位置 =/root/.pyenv/versions/3.6.5/lib/python3.6/site-packages/ansible可执行位置 =/root/.pyenv/versions/3.6.5/bin/ansiblepython 版本 = 3.6.5(默认,2020 年 6 月 18 日,17:32:20)[GCC 4.8.5 20150623(红帽 4.8.5-39)][root@xxx bin]#
解决方案
我刚刚为此失去了一整天,我设法通过运行 sudo yum install libselinux-python3
I am trying to run Ansible playbook command and getting an error as below.
When I checked for libselinux-python, it showsit is already available.
[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.
[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]#
解决方案
I've just lost a whole day to this and I managed to solve it running sudo yum install libselinux-python3
这篇关于中止,目标使用 selinux 但未安装 Python 绑定 (libselinux-Python)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!