Erste Config für media.
This commit is contained in:
parent
543f650d84
commit
bffd8b1db9
12 changed files with 77 additions and 33 deletions
5
roles/nginx/files/etc/nginx/include/listing.conf
Normal file
5
roles/nginx/files/etc/nginx/include/listing.conf
Normal file
|
@ -0,0 +1,5 @@
|
|||
location / {
|
||||
autoindex on;
|
||||
autoindex_exact_size on;
|
||||
autoindex_localtime off;
|
||||
}
|
2
roles/website/ffnord/handlers/main.yml
Normal file
2
roles/website/ffnord/handlers/main.yml
Normal file
|
@ -0,0 +1,2 @@
|
|||
---
|
||||
- include: ../../includes/base-static/handlers/main.yml
|
|
@ -1,4 +0,0 @@
|
|||
---
|
||||
handlers:
|
||||
- include: ../../nginx/handlers/main.yml
|
||||
|
|
@ -1,3 +1,4 @@
|
|||
---
|
||||
dependencies:
|
||||
- { role: nginx }
|
||||
- role: nginx
|
||||
|
||||
|
|
|
@ -1,30 +1,13 @@
|
|||
---
|
||||
- name: configure ffnord.net site
|
||||
copy: >
|
||||
src=etc/nginx/sites-available/ffnord.net
|
||||
dest=/etc/nginx/sites-available/ffnord.net
|
||||
owner=root
|
||||
group=root
|
||||
mode=0644
|
||||
notify: reload nginx config
|
||||
tags:
|
||||
- nginx
|
||||
- website
|
||||
- ffnord
|
||||
|
||||
- name: enable ffnord.net site
|
||||
file: >
|
||||
src=/etc/nginx/sites-available/ffnord.net
|
||||
dest=/etc/nginx/sites-enabled/ffnord.net
|
||||
owner=root
|
||||
group=root
|
||||
mode=0644
|
||||
state=link
|
||||
notify: reload nginx config
|
||||
tags:
|
||||
- nginx
|
||||
- website
|
||||
- ffnord
|
||||
- include: ../../includes/base-static/tasks/main.yml
|
||||
vars:
|
||||
site: ffnord.net
|
||||
domains:
|
||||
- ffnord.net
|
||||
- www.ffnord.net
|
||||
- nord.freifunk.net
|
||||
document_root: /var/www/ffnord.net/site
|
||||
listing: false
|
||||
|
||||
- name: clone ffnord.net repository
|
||||
git: repo=https://github.com/ffnord/ffnord.net.git dest=/var/www/ffnord.net
|
||||
|
|
2
roles/website/includes/base-static/handlers/main.yml
Normal file
2
roles/website/includes/base-static/handlers/main.yml
Normal file
|
@ -0,0 +1,2 @@
|
|||
---
|
||||
- include: ../../../../nginx/handlers/main.yml
|
28
roles/website/includes/base-static/tasks/main.yml
Normal file
28
roles/website/includes/base-static/tasks/main.yml
Normal file
|
@ -0,0 +1,28 @@
|
|||
---
|
||||
- name: configure {{ site }} site
|
||||
template: >
|
||||
src=site.j2
|
||||
dest=/etc/nginx/sites-available/{{ site }}
|
||||
owner=root
|
||||
group=root
|
||||
mode=0644
|
||||
notify: reload nginx config
|
||||
tags:
|
||||
- nginx
|
||||
- website
|
||||
- "{{ site }}"
|
||||
|
||||
- name: enable {{ site }} site
|
||||
file: >
|
||||
src=/etc/nginx/sites-available/{{ site }}
|
||||
dest=/etc/nginx/sites-enabled/{{ site }}
|
||||
owner=root
|
||||
group=root
|
||||
mode=0644
|
||||
state=link
|
||||
notify: reload nginx config
|
||||
tags:
|
||||
- nginx
|
||||
- website
|
||||
- "{{ site }}"
|
||||
|
|
@ -3,11 +3,15 @@ server {
|
|||
include /etc/nginx/include/no_dotfiles.conf;
|
||||
include /etc/nginx/include/no_symlinks.conf;
|
||||
|
||||
{% if listing %}
|
||||
include /etc/nginx/include/listing.conf;
|
||||
{% endif %}
|
||||
|
||||
listen 80;
|
||||
listen [::]:80;
|
||||
|
||||
server_name ffnord.net www.ffnord.net nord.freifunk.net;
|
||||
server_name {{ domains | join(" ") }};
|
||||
|
||||
root /var/www/ffnord.net/site;
|
||||
root {{ document_root }};
|
||||
}
|
||||
|
2
roles/website/media/handlers/main.yml
Normal file
2
roles/website/media/handlers/main.yml
Normal file
|
@ -0,0 +1,2 @@
|
|||
---
|
||||
- include: ../../includes/base-static/handlers/main.yml
|
4
roles/website/media/meta/main.yml
Normal file
4
roles/website/media/meta/main.yml
Normal file
|
@ -0,0 +1,4 @@
|
|||
---
|
||||
dependencies:
|
||||
- role: nginx
|
||||
|
16
roles/website/media/tasks/main.yml
Normal file
16
roles/website/media/tasks/main.yml
Normal file
|
@ -0,0 +1,16 @@
|
|||
---
|
||||
- include: ../../includes/base-static/tasks/main.yml
|
||||
vars:
|
||||
site: media_ffhh
|
||||
domains:
|
||||
- media.services.ffhh
|
||||
- media.hamburg.freifunk.net
|
||||
document_root: /var/www/media
|
||||
listing: true
|
||||
|
||||
- name: create media root
|
||||
file: path=/var/www/media state=directory owner=www-data group=www-data mode=0755
|
||||
tags:
|
||||
- nginx
|
||||
- website
|
||||
- media_ffhh
|
|
@ -3,4 +3,5 @@
|
|||
roles:
|
||||
- ntp-server
|
||||
- website/ffnord
|
||||
- website/media
|
||||
|
||||
|
|
Loading…
Reference in a new issue