2017-05-30 12 views
1

脚本:UbuntuでSELinuxを無効にする方法は?

--- 
- 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のような他のライブラリを試してみると、システムにインストールできませんでした。

答えて

3

タスクをこれに変更します。最初にpython-selinuxをインストールする必要があります。 Ansible intro install requirements

タスクにこれを追加する必要があります。

- name: Install the libselinux-python package 
    apt: name=python-selinux state=present 

全体のタスクはこのようになります。

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

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

- name: Install the libselinux-python package 
    apt: name=python-selinux state=present 

- name: Disable SELinux 
    selinux: state=disabled 
+0

私はそれを試みましたが、それは言った: 'fatal:[server]:FAILED! => {"changed":false、 "failed":true、 "msg": "libselinux-pythonに一致するパッケージはありません"} '。 –

+0

@cloud_cloudこれは役に立ちます。http://packages.ubuntu.com/source/trusty-updates/libselinux –

+0

どうもありがとうございました。しかし、今回は: '致命的:[rancherserver]:失敗しました! "module_stderr": "192.168.33.111への共有接続が閉じられました。\ r \ n"、 "module_stdout": "トレースバック(最新の呼び出し最後):\ r \ nファイル\ "/ tmp/ansible_T58IMt/ansible_module _selinux.py \"、 '。 –

関連する問題