2019-03-16 19:54:32 +01:00

64 lines
1.3 KiB
YAML

---
- name: install packages
apk: "name={{ item }} state=latest"
with_items: "{{ install_packages }}"
- name: symlink /usr/bin/php
file:
src: /usr/bin/php7
dest: /usr/bin/php
state: link
- name: download grav
get_url:
url: https://getgrav.org/download/core/grav-admin/1.5.6
dest: /var/www/localhost/grav-cms.zip
- name: extract grav
unarchive:
src: /var/www/localhost/grav-cms.zip
dest: /var/www/localhost
remote_src: yes
owner: lighttpd
group: lighttpd
mode: 0750
- name: remove old htdocs
file:
path: /var/www/localhost/htdocs
state: absent
- name: link to htdocs
file:
src: /var/www/localhost/grav-admin
dest: /var/www/localhost/htdocs
state: link
- name: install lighttpd config
copy:
src: lighttpd.conf
dest: /etc/lighttpd/lighttpd.conf
- name: install grav config
copy:
src: lighttpd-grav.conf
dest: /etc/lighttpd/grav.conf
- name: install php-cgi config
copy:
src: lighttpd-php-cgi.conf
dest: /etc/lighttpd/php-cgi.conf
- name: add php-cgi.conf to lighttpd config
lineinfile:
path: /etc/lighttpd/lighttpd.conf
line: 'include "php-cgi.conf"'
- name: add grav.conf to lighttpd config
lineinfile:
path: /etc/lighttpd/lighttpd.conf
line: 'include "grav.conf"'
- name: restart lighttpd
command: rc-service lighttpd restart