home-server/roles/dmz_dotclear_front/tasks/main.yml

70 lines
1.8 KiB
YAML

---
# The home-server project produces a multi-purpose setup using Ansible.
# Copyright © 2018 Y. Gablin, under the GPL-3.0-or-later license.
# Full licensing information in the LICENSE file, or gnu.org/licences/gpl-3.0.txt if the file is missing.
- name: make sure the path to dotclear exists
file:
path: "{{dotclear_root | dirname}}"
state: directory
mode: 0755
- name: download dotclear
get_url:
url: 'http://download.dotclear.org/latest.tar.gz'
dest: /tmp/
connection: local
register: targz
changed_when: false
- name: upload dotclear to host and extract it
unarchive:
src: "{{targz.dest}}"
dest: "{{dotclear_root | dirname}}"
creates: "{{dotclear_root}}"
owner: http
group: http
mode: ug+rwX,o=
- name: create the LDAP authentication class
template:
src: templates/ldap_auth.php.j2
dest: "{{dotclear_root}}/inc/ldap_auth.php"
owner: http
group: http
mode: 0400
- name: configure dotclear
template:
src: templates/config.php.j2
dest: "{{dotclear_root}}/inc/config.php"
owner: http
group: http
mode: 0400
- name: configure nginx for dotclear
copy:
content: |
location = / {
rewrite ^ $scheme://{{net_soa}}{{http_pfx_dotclear}} redirect;
}
location {{http_pfx_dotclear}} {
alias {{dotclear_root}};
autoindex on;
rewrite ^({{http_pfx_dotclear}})(/.*?\.php)(/.*)?$ /php...$document_root/...$1/...$2/...$3 last;
}
dest: /etc/nginx/inc.d/dotclear.http.inc
mode: 0440
owner: http
group: http
notify:
- restart nginx.service
### LOCAL COMMIT ⇒ ###
- name: commit local changes
include_role: name=etckeeper.inc allow_duplicates=true tasks_from=local.yml
vars:
msg: dotclear
### ⇐ LOCAL COMMIT ###
- meta: flush_handlers