Skip to content
Snippets Groups Projects
Commit a343b257 authored by Pietsch, Martin's avatar Pietsch, Martin
Browse files

migrated content from role package.lighttpd

parents
No related branches found
No related tags found
No related merge requests found
Description
===========
This role installs a HTTP server based on lighttpd.
Requirement
===========
Variables
---------
- lighttpd\_datadirectory:
description:
- path to the data directory
default: /var/www
- lighttpd\_configfile:
description:
- path to the configuration file of lighttpd
default: /usr/local/etc/lighttpd/lighttpd.conf
Process
=======
main
----
1. install and enable lighttpd
2. copy lighttpd configuration
3. create lighttpd directory
4. create system\_config\_directory/lighttpd directory
5. start lighttpd
configure
---------
1. copy lighttpd configuration file
2. start lighttpd service
3. reload lighttpd service
License
=======
BSD-3-Clauses
Contributors
============
* Martin Pietsch (martin.pietsch@tu-dresden.de)
---
---
---
- include_vars:
file: "{{ sdm_system_vars_file }}"
when: lookup('isvarsfile', sdm_system_vars_file)
---
- call_tasks:
from: _init
- name: copy lighttpd configuration
template:
src: "{{ lighttpd_configfile }}"
dest: "{{ system_config_directory }}/lighttpd/lighttpd.conf"
owner: root
group: wheel
mode: 0644
- name: start lighttpd
service:
name: "{{ _service }}"
state: started
loop: "{{ package_services }}"
loop_control:
loop_var: _service
register: _lighttpd_started
- name: reload lighttpd
service:
name: "{{ _service }}"
state: started
loop: "{{ package_services }}"
loop_control:
loop_var: _service
when: _lighttpd_started.changed == False
---
- call_tasks:
from: _init
- name: install lighttpd
call_tasks:
super: true
- name: create lighttpd data directory
file:
path: "{{ lighttpd_datadirectory }}"
state: directory
mode: 0755
- name: "create {{ system_config_directory }}/lighttpd directory"
file:
path: "{{ system_config_directory }}/lighttpd"
state: directory
mode: 0755
- call_tasks:
from: configure
dir-listing.encoding = "utf-8"
server.dir-listing = "enable"
server.document-root = "{{ lighttpd_datadirectory }}"
server.username = "nobody"
server.groupname = "nobody"
server.pid-file = "/var/run/lighttpd.pid"
index-file.names = ( "index.html" )
mimetype.assign = (
".html" => "text/html",
".txt" => "text/plain",
".css" => "text/css",
".js" => "application/x-javascript",
".jpg" => "image/jpeg",
".jpeg" => "image/jpeg",
".gif" => "image/gif",
".png" => "image/png",
"" => "application/octet-stream"
)
---
lighttpd_datadirectory: "/var/www"
lighttpd_configfile: "lighttpd.conf.j2"
package_packages: ["lighttpd"]
package_services: ["lighttpd"]
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment