を有効にすでにUbuntu 16.04
上のApache2モジュールを有効に:が有効にモジュール書き換えの設定に失敗しました:モジュールの書き換えはすでに私が使用可能にしようと、次のエラーを取得しています
Failed to set module rewrite to enabled: Module rewrite already enabled
マイタスク
- name: Enable mod_rewrite
apache2_module:
state: present
name: rewrite
force: true
ignore_configcheck: true
エラーが発生しました
TASK [apache : Enable mod_rewrite] ****************************************************************************
fatal: [vps]: FAILED! => {"changed": false, "failed": true, "msg": "Failed to set module rewrite to enabled: Module rewrite already enabled\n", "rc": 0, "stderr": "", "stderr_lines": [], "stdout": "Module rewrite already enabled\n", "stdout_lines": ["Module rewrite already enabled"]}
to retry, use: --limit @/home/me/ansible_ubuntu/ansible/playbook.retry
私は現在Ansibleになっています。
私はforce
パラメータを使用しようとしましたが、次にignore_configcheck
と同じ結果が得られました。
クライアントのPython:2.7.6
サーバーのPython:2.7.12
更新#1
はそれだけで、それがインストールされますことを伝える続けるのではなく停止するべきではないでしょうか。 a2dismod
[email protected]:/etc/apache2/sites-available$ a2dismod
Your choices are: access_compat alias auth_basic authn_core authn_file authz_core authz_host authz_user autoindex deflate dir env fastcgi filter headers mime mpm_event negotiation proxy proxy_fcgi rewrite setenvif status
Which module(s) do you want to disable (wildcards ok)?
の
アップデート#2
出力アップデート#3
私は、モジュールの名前全体を反映して、コメントの一つあたりのタスクを変更:
- name: Enable mod_rewrite
apache2_module:
state: present
name: mod_rewrite
force: true
ignore_configcheck: true
は異なるエラーを得た:
TASK [apache : Enable mod_rewrite] ****************************************************************************
fatal: [vps]: FAILED! => {"changed": false, "failed": true, "msg": "Failed to set module mod_rewrite to enabled: ", "rc": 1, "stderr": "ERROR: Module mod_rewrite does not exist!\n", "stderr_lines": ["ERROR: Module mod_rewrite does not exist!"], "stdout": "", "stdout_lines": []}
to retry, use: --limit @/home/me/ansible_ubuntu/ansible/playbook.retry
更新#4
ソリューションtask.yml
で
:
- 名: 状態:本 名:リライトのmod_rewrite apache2_moduleを有効にします force:true ignore_configcheck:
真ansible/modules/web_infrastructure/apache2_modules.py
# a2enmod name replacement to apache2ctl -M names
text_workarounds = [
('shib2', 'mod_shib'),
('evasive', 'evasive20_module'),
('rewrite', 'rewrite_module'),
('headers', 'headers_module'),
]
'a2dismod'はターゲットホストにインストールされていますか? – Zlemini
更新#2を参照してください。 – TekiusFanatikus
これは狂っていますが、Ansibleはハードコードされたモジュール名でこのエラーの原因となる状況を処理します。 https://github.com/ansible/ansible/blob/devel/lib/ansible/modules/web_infrastructure/apache2_module.py#L153代わりに 'name:mod_rewrite'を試すことができますか?また、 'apache2ctl -M'の結果でモジュールの名前が何であるか確認してください。 – techraf