How do I run the ansible seport module in Fedora 26?

449 views Asked by At

Running the ansible seport module in Fedora 26 produces the following error:

This module requires policycoreutils-python

However, policycoreutils-python is already installed.

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

There are 1 answers

0
Roy Hyunjin Han On

To fix this issue, install the enum34 python package:

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

The enum package is in Python 3 but not in Python 2. The enum34 package backports enum to Python 2. The root cause is this line in setools/policyrep/util.py:

from enum import Enum

Please check these links for more information: