diff options
-rw-r--r-- | inventory/hosts.ini | 2 | ||||
-rw-r--r-- | roles/nginx/vhost/templates/static-files-with-acme.conf.j2 | 8 | ||||
-rw-r--r-- | spreadspace/glt-stream.yml | 55 |
3 files changed, 65 insertions, 0 deletions
diff --git a/inventory/hosts.ini b/inventory/hosts.ini index ae6ea37a..0a922e17 100644 --- a/inventory/hosts.ini +++ b/inventory/hosts.ini @@ -144,6 +144,7 @@ glt-live-tug [glt-live-misc] glt-coturn host_name=cdn13 glt-jitsi host_name=cdn12 +glt-stream host_name=stream [glt-live-r3] glt-gw-r3 host_name=gw-r3 @@ -379,6 +380,7 @@ ch-mimas2 ele-lt glt-coturn glt-jitsi +glt-stream [hcloud:children] emc-dist diff --git a/roles/nginx/vhost/templates/static-files-with-acme.conf.j2 b/roles/nginx/vhost/templates/static-files-with-acme.conf.j2 index f99d6eb4..3dec7f27 100644 --- a/roles/nginx/vhost/templates/static-files-with-acme.conf.j2 +++ b/roles/nginx/vhost/templates/static-files-with-acme.conf.j2 @@ -21,6 +21,10 @@ server { ssl_certificate_key /var/lib/acme/live/{{ nginx_vhost.hostnames[0] }}/privkey; include snippets/hsts.conf; +{% if 'directives_extra' in nginx_vhost and 'server' in nginx_vhost.directives_extra %} + {{ nginx_vhost.directives_extra.server | indent(4) }} + +{% endif %} location / { root {{ nginx_vhost.root }}; {% if 'index' in nginx_vhost %} @@ -32,5 +36,9 @@ server { autoindex_format {{ nginx_vhost.autoindex.format }}; {% endif %} {% endif %} +{% if 'directives_extra' in nginx_vhost and 'location' in nginx_vhost.directives_extra %} + + {{ nginx_vhost.directives_extra.location | indent(8) }} +{% endif %} } } diff --git a/spreadspace/glt-stream.yml b/spreadspace/glt-stream.yml new file mode 100644 index 00000000..3a897377 --- /dev/null +++ b/spreadspace/glt-stream.yml @@ -0,0 +1,55 @@ +--- +- name: Basic Setup + hosts: glt-stream + roles: + - role: apt-repo/base + - role: core/base + - role: core/sshd + - role: core/zsh + - role: core/ntp + - role: apt-repo/spreadspace + - role: acmetool/base + - role: nginx/base + post_tasks: + - name: create logical volume + lvol: + vg: "{{ host_name }}" + lv: www + size: 10G + + - name: create filesystem + filesystem: + fstype: ext4 + dev: "/dev/mapper/{{ host_name | replace('-', '--') }}-www" + + - name: mount filesytem + mount: + src: "/dev/mapper/{{ host_name | replace('-', '--') }}-www" + path: /srv/www + fstype: ext4 + state: mounted + + - name: create base directory for static www content + file: + path: /srv/www/stream + state: directory + + - name: configure default vhost stream.linuxtage.at + vars: + nginx_vhost: + default: yes + name: stream + template: static-files-with-acme + acme: yes + hostnames: + - stream.linuxtage.at + root: /srv/www/stream + index: index.html + directives_extra: + server: |- + add_header Access-Control-Allow-Headers "origin,range,accept-encoding,referer"; + add_header Access-Control-Allow-Methods "GET,HEAD,OPTIONS"; + add_header Access-Control-Allow-Origin "*"; + add_header Access-Control-Expose-Headers "Server,range,Content-Length,Content-Range,Date"; + include_role: + name: nginx/vhost |