updated haproxy state
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Paul 2025-01-08 20:10:04 +01:00
parent 015c64ee58
commit 8adf2558d9
10 changed files with 117 additions and 0 deletions

View File

@ -1,5 +1,26 @@
---
{%- from "haproxy/map.jinja" import haproxy with context %}
haproxy-errors-dir:
file.managed:
- name: {{ haproxy.config.dir }}/errors/{{ errorfile }}
- source: salt://haproxy/templates/errors/{{ errorfile }}
- user: {{ haproxy.config.user }}
- group: {{ haproxy.config.group }}
- mode: "0700"
{% for errorfile in haproxy.errorfiles %}
haproxy-errors-{{ errorfile }}:
file.managed:
- name: {{ haproxy.config.dir }}/errors/{{ errorfile }}
- source: salt://haproxy/templates/errors/{{ errorfile }}
- user: {{ haproxy.config.user }}
- group: {{ haproxy.config.group }}
- mode: "0600"
- watch_in:
- service: haproxy-service
{% endfor %}
{% for map in haproxy.config.maps %}
haproxy-maps-{{ map }}:
file.managed:

View File

@ -14,6 +14,15 @@ haproxy:
fetchurl: https://github.com/jhunt/hatop/releases/download
version: "0.8.2"
hash: sha256=6ba2136e98b9a436488be67a54a5295f55f38090157d09df0154dda493ac5815
errorfiles:
- 400.http
- 403.http
- 404.http
- 408.http
- 500.http
- 502.http
- 503.http
- 504.http
config:
dir: /etc/haproxy
configfile: haproxy.cfg

View File

@ -0,0 +1,9 @@
HTTP/1.0 400 Bad request
Cache-Control: no-cache
Connection: close
Content-Type: text/html
<html><body><h1>400 Bad request</h1>
Your browser sent an invalid request.
</body></html>

View File

@ -0,0 +1,9 @@
HTTP/1.0 403 Forbidden
Cache-Control: no-cache
Connection: close
Content-Type: text/html
<html><body><h1>403 Forbidden</h1>
Request forbidden by administrative rules.
</body></html>

View File

@ -0,0 +1,9 @@
HTTP/1.0 404 Not Found
Cache-Control: no-cache
Connection: close
Content-Type: text/html
<html><body><h1>404 Not Found</h1>
Request forbidden by administrative rules. :)
</body></html>

View File

@ -0,0 +1,9 @@
HTTP/1.0 408 Request Time-out
Cache-Control: no-cache
Connection: close
Content-Type: text/html
<html><body><h1>408 Request Time-out</h1>
Your browser didn't send a complete request in time.
</body></html>

View File

@ -0,0 +1,9 @@
HTTP/1.0 500 Internal Server Error
Cache-Control: no-cache
Connection: close
Content-Type: text/html
<html><body><h1>500 Internal Server Error</h1>
An internal server error occurred.
</body></html>

View File

@ -0,0 +1,9 @@
HTTP/1.0 502 Bad Gateway
Cache-Control: no-cache
Connection: close
Content-Type: text/html
<html><body><h1>502 Bad Gateway</h1>
The server returned an invalid or incomplete response.
</body></html>

View File

@ -0,0 +1,24 @@
HTTP/1.0 503 Service Unavailable
Cache-Control: no-cache
Connection: close
Content-Type: text/html
<!doctype html>
<title>Site Maintenance</title>
<style>
body { text-align: center; padding: 150px; }
h1 { font-size: 50px; }
body { font: 20px Helvetica, sans-serif; color: #333; }
article { display: block; text-align: left; width: 650px; margin: 0 auto; }
a { color: #dc8100; text-decoration: none; }
a:hover { color: #333; text-decoration: none; }
</style>
<article>
<h1>We&rsquo;ll be back soon!</h1>
<div>
<p>Sorry for the inconvenience but we&rsquo;re performing some maintenance at the moment. If you need to you can always <a href="mailto:#">contact us</a>, otherwise we&rsquo;ll be back online shortly!</p>
<p>&mdash; The Team</p>
</div>
</article>

View File

@ -0,0 +1,9 @@
HTTP/1.0 504 Gateway Time-out
Cache-Control: no-cache
Connection: close
Content-Type: text/html
<html><body><h1>504 Gateway Time-out</h1>
The server didn't respond in time.
</body></html>