如何用Ansible禁用Ubuntu上的SELinux?

2024-05-12 13:18:25 发布

您现在位置:Python中文网/ 问答频道 /正文

剧本:

---
- name: Update repositories cache
  apt: update_cache=yes

- name: Install build-essential
  apt: name=build-essential state=present

- name: Disable SELinux
  selinux: state=disabled

结果是:

TASK [common : Update repositories cache] ***************************************************************************************************************************************************************************************************
changed: [server]

TASK [common : Install build-essential] *****************************************************************************************************************************************************************************************************
ok: [server]

TASK [common : Disable SELinux] *************************************************************************************************************************************************************************************************************
fatal: [server]: FAILED! => {"changed": false, "failed": true, "msg": "libselinux-python required for this module"}

我试图找到libselinux-python,但它似乎不存在。当我尝试其他库(如python-selinux)时,无法在系统上安装。


Tags: installnamebuildcachetaskserveraptupdate