# This playbook install the lighttpd with FastCGI and PHP support. # # Copyright (c) 2013-2017 Fabian Affolter # # Licensed under CC BY 3.0. All rights reserved. # --- - hosts: all user: root tasks: - name: install the lighttpd web server command: /sbin/apk add lighttpd - name: install php packages command: /sbin/apk add {{ item }} with_items: - php-common - php-iconv - php-json - php-gd - php-curl - php-xml - php-pgsql - php-imap - php-pdo - php-pdo_pgsql - php-soap - php-xmlrpc - php-posix - php-mcrypt - php-gettext - php-ldap - php-ctype - php-dom - name: enable fastcgi support in lighttpd.conf lineinfile: dest=/etc/lighttpd/lighttpd.conf regexp='^ include "mod_fastcgi.conf"' insertafter='^# include "mod_fastcgi.conf"' line=' include "mod_fastcgi.conf"' state=present - name: start the lighttpd service command: /etc/init.d/lighttpd start - name: add lighttpd to the default runlevel command: rc-update add lighttpd default - name: install a default index.html file template: src=../files/lighttpd.j2 dest=/var/www/localhost/htdocs/index.html owner=lighttpd group=lighttpd mode=0644