Ansible沒有安裝Apache的重寫模塊。Ansible沒有安裝Apache重寫模塊
Ansible任務:
- name: Enable mod_rewrite
apache2_module:
state: present
name: rewrite
TAKS結果:
TASK [apache : Enable mod_rewrite] *********************************************
fatal: [local_vm]: FAILED! => {"changed": false, "failed": true, "msg": "Error executing /usr/sbin/apache2ctl: AH00526: Syntax error on line 33 of /etc/apache2/sites-enabled/mysite.conf:\nInvalid command 'RewriteEngine', perhaps misspelled or defined by a module not included in the server configuration\n"}
我注意到,該模塊沒有啓用:
[email protected]:/etc/apache2/mods-enabled$ ls | grep write
[email protected]:/etc/apache2/mods-enabled$
更新#1
這裏是mysite.conf的內容:
32: # Redirect to https
33: RewriteEngine On
34: RewriteCond %{REQUEST_URI} !^\/lightbox
mysite.conf的內容是什麼?至少在犯罪線附近。 – tedder42
增加了更新1,指出問題出在哪裏的第33行。 – TekiusFanatikus
那麼問題是什麼?似乎Apache抱怨模塊不可用。它與Ansible有什麼關係?是否啓用它從CLI工作,但不是Ansible? – techraf