python - 中止,目标使用 selinux 但未安装 Python 绑定(bind) (libselinux-Python)

标签 python ansible

我正在尝试运行 Ansible playbook 命令并收到如下错误。

fatal: [localhost]: FAILED! => {"changed": false, "msg": "Aborting, target
uses selinux but python bindings (libselinux-python) aren't installed!"}

当我检查 libselinux-python 时,它显示它已经可用。
[root@host all]# sudo yum list installed |grep libselinux-python
libselinux-python3.x86_64            2.5-15.el7              @rhel-7-server-rpms
如果有人遇到并解决了这个问题,请提供您的意见。
下面是我在服务器上安装的 Python 和 Ansible 版本。
[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]#

最佳答案

我刚刚为此浪费了一整天,我设法通过运行 sudo yum install libselinux-python3 解决了它

关于python - 中止,目标使用 selinux 但未安装 Python 绑定(bind) (libselinux-Python),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63173955/

相关文章:

python - 在分组后将值滚动粘贴到字符串

python - Seaborn regplot 中点和线的不同颜色

ubuntu - 通过 Ansible 启动 Docker 守护进程

automation - Ansible lineinfile 模块属性行未在服务器上添加环境变量

python - 3D图像旋转简单ITK Python

python - 在列表列表中查找不完全匹配

python - Python 中的高效矢量/点类

ansible - 从变量创建字典键并添加 IP 列表作为值

将在 postgres SQL 数据库实例上运行查询的 Ansible Playbook

python - python 虚拟环境中没有名为 yaml 的模块