@ -1,5 +1,5 @@ | |||||
--- | --- | ||||
- name: restart "{{ service_name }}" | |||||
- name: restart {{ service_name }} | |||||
service: name="{{ service_name }}" state=restarted | service: name="{{ service_name }}" state=restarted | ||||
- name: reload "{{ service_name }}" | |||||
- name: reload {{ service_name }} | |||||
service: name="{{ service_name }}" state=reloaded | service: name="{{ service_name }}" state=reloaded |
@ -1,2 +0,0 @@ | |||||
--- | |||||
php: false |
@ -1,16 +0,0 @@ | |||||
--- | |||||
- include: service.yaml | |||||
vars: | |||||
service_name: apache2 | |||||
service_packages: | |||||
- apache2 | |||||
- name: validate apache2 configuration | |||||
command: nginx -t -c /etc/nginx/nginx.conf | |||||
changed_when: False | |||||
- name: enable apache configuration | |||||
file: | |||||
src: "/etc/apache2/sites-available/{{ config_name }}" | |||||
dest: "/etc/apache2/sites-enabled/{{ config_name }}" | |||||
state: link | |||||
notify: restart apache2 |
@ -1,3 +1,4 @@ | |||||
--- | --- | ||||
dependencies: | dependencies: | ||||
- role: nginx | - role: nginx | ||||
php: true |
@ -0,0 +1,36 @@ | |||||
server { | |||||
listen 80; | |||||
listen [::]:80; | |||||
server_name wiki.domain.example; | |||||
return 301 https://$server_name$request_uri; | |||||
} | |||||
server { | |||||
listen [::]:443 ssl; | |||||
listen 443 ssl; | |||||
client_max_body_size 4M; | |||||
client_body_buffer_size 128k; | |||||
root /usr/share/dokuwiki; | |||||
index doku.php; | |||||
location ~ /(data/|conf/|bin/|inc/|install.php) { deny all; } | |||||
location / { try_files $uri $uri/ @dokuwiki; } | |||||
location @dokuwiki { | |||||
rewrite ^/_media/(.*) /lib/exe/fetch.php?media=$1 last; | |||||
rewrite ^/_detail/(.*) /lib/exe/detail.php?media=$1 last; | |||||
rewrite ^/_export/([^/]+)/(.*) /doku.php?do=export_$1&id=$2 last; | |||||
rewrite ^/(.*) /doku.php?id=$1&$args last; | |||||
} | |||||
location ~ \.php$ { | |||||
try_files $uri $uri/ /doku.php; | |||||
include fastcgi_params; | |||||
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; | |||||
fastcgi_param REDIRECT_STATUS 200; | |||||
fastcgi_pass unix:/var/run/php5-fpm.sock; | |||||
} | |||||
} |
@ -1,2 +1,3 @@ | |||||
--- | --- | ||||
is_proxy: false | is_proxy: false | ||||
php: false |
@ -1,6 +1,6 @@ | |||||
--- | --- | ||||
- name: install "{{ service_name }}" | |||||
- name: install {{ service_name }} | |||||
apt: name="{{ item }}" state=present | apt: name="{{ item }}" state=present | ||||
with_items: "{{ service_packages }}" | with_items: "{{ service_packages }}" | ||||
- name: start "{{ service_name }}" at boot | |||||
service: name="{{ service_name }}" state=started enabled=yes | |||||
- name: start {{ service_name }} at boot | |||||
service: name="{{ service_name }}" enabled=yes |