如何在Fedora 26中运行ansible seport模块?

时间:2017-09-06 14:53:28

标签: ansible selinux fedora-26

在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

1 个答案:

答案 0 :(得分:0)

要解决此问题,请安装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包向{2}移植enum。根本原因是setools/policyrep/util.py中的这一行:

from enum import Enum

请查看以下链接以获取更多信息: