From f72cb0e01c57ef2964822daca06bb57946724ec3 Mon Sep 17 00:00:00 2001 From: Christian Boltz Date: Jan 10 2020 21:33:34 +0000 Subject: Merge branch 'cboltz-add-jekyll' into 'production' add jekyll.infra.o.o including base nginx config See merge request infra/salt!306 --- diff --git a/pillar/id/jekyll_infra_opensuse_org.sls b/pillar/id/jekyll_infra_opensuse_org.sls new file mode 100644 index 0000000..ea5e0b7 --- /dev/null +++ b/pillar/id/jekyll_infra_opensuse_org.sls @@ -0,0 +1,21 @@ +grains: + city: nuremberg + country: de + hostusage: + - news.o.o + - planet.o.o + roles: + - web_jekyll + reboot_safe: yes + salt_cluster: opensuse + virt_cluster: atreju + + aliases: [] + description: Webserver running jekyll-managed websites like news.o.o and planet.o.o + documentation: [] + responsible: + - hellcp + partners: [] + weburls: + - https://news.opensuse.org + - https://planet.opensuse.org diff --git a/pillar/role/web_jekyll.sls b/pillar/role/web_jekyll.sls new file mode 100644 index 0000000..5dc3bec --- /dev/null +++ b/pillar/role/web_jekyll.sls @@ -0,0 +1,53 @@ +{% set websites = ['news', 'planet'] %} + +include: + - role.common.nginx + +nginx: + ng: + servers: + managed: + {% for website in websites %} + {{ website }}.opensuse.org.conf: + config: + - map $sent_http_content_type $expires: + - text/css: 7d + - image/x-icon: 90d + - ~application/: 28d + - ~font/: 28d + - ~text/: 28d + - ~image/: 28d + - server: + - server_name: {{ website }}.opensuse.org + - listen: + - 80 + {% if website == 'news' %} + - default_server + {% endif %} + - root: /srv/www/vhosts/{{ website }}.opensuse.org + - gzip_vary: 'on' + - gzip_min_length: 1000 + - gzip_comp_level: 5 + - gzip_types: + - text/plain + - text/xml text/x-js + - application/json + - text/css + - application/x-javascript + - application/javascript + - expires: $expires + - location /: + - index: + - index.html + - index.htm + - location ~* \.(?:ttf|otf|eot|woff)$: + - add_header: Access-Control-Allow-Origin "*" + - error_page: 405 = $uri + - error_page: 405 =200 $uri + - error_page: 500 502 503 504 /50x.html + - location = /50x.html: + - root: /srv/www/htdocs + - access_log: /var/log/nginx/{{ website }}.access.log combined + - error_log: /var/log/nginx/{{ website }}.error.log + enabled: True + {% endfor %} diff --git a/salt/role/web_jekyll.sls b/salt/role/web_jekyll.sls new file mode 100644 index 0000000..a5b1924 --- /dev/null +++ b/salt/role/web_jekyll.sls @@ -0,0 +1,2 @@ +include: + - profile.web.server.nginx