【问题标题】:How do I run the ansible seport module in Fedora 26?如何在 Fedora 26 中运行 ansible seport 模块?
【发布时间】:2017-09-06 14:53:27
【问题描述】:

在 Fedora 26 中运行 ansible seport 模块会产生以下错误:

This module requires policycoreutils-python

但是,policycoreutils-python 已经安装。

- name: install system packages
  package: name={{ item }} state=present
  become: true
  with_items:
    - libselinux-python
    - policycoreutils-python

【问题讨论】:

    标签: ansible selinux fedora-26


    【解决方案1】:

    要解决此问题,请安装 enum34 python 包:

    - name: install system packages
      package: name={{ item }} state=present
      become: true
      with_items:
        - libselinux-python
        - policycoreutils-python
        - python-enum34
    

    enum 包在 Python 3 中,但不在 Python 2 中。enum34 包将 enum 反向移植到 Python 2。根本原因是 setools/policyrep/util.py 中的这一行:

    from enum import Enum
    

    请查看以下链接了解更多信息:

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2018-05-16
      • 1970-01-01
      • 2017-07-27
      • 2018-03-20
      • 2018-04-23
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多