aboutsummaryrefslogtreecommitdiffstats
path: root/maintenance/lighttpd.yml
blob: c2928d994c536f8a755f89b62e01385b7dfe79ab (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# This playbook install the lighttpd with FastCGI and PHP support.
#
# Copyright (c) 2013-2017 Fabian Affolter <fabian@affolter-engineering.ch>
#
# 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