This commit is contained in:
parent
015c64ee58
commit
8adf2558d9
@ -1,5 +1,26 @@
|
|||||||
---
|
---
|
||||||
{%- from "haproxy/map.jinja" import haproxy with context %}
|
{%- 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 %}
|
{% for map in haproxy.config.maps %}
|
||||||
haproxy-maps-{{ map }}:
|
haproxy-maps-{{ map }}:
|
||||||
file.managed:
|
file.managed:
|
||||||
|
@ -14,6 +14,15 @@ haproxy:
|
|||||||
fetchurl: https://github.com/jhunt/hatop/releases/download
|
fetchurl: https://github.com/jhunt/hatop/releases/download
|
||||||
version: "0.8.2"
|
version: "0.8.2"
|
||||||
hash: sha256=6ba2136e98b9a436488be67a54a5295f55f38090157d09df0154dda493ac5815
|
hash: sha256=6ba2136e98b9a436488be67a54a5295f55f38090157d09df0154dda493ac5815
|
||||||
|
errorfiles:
|
||||||
|
- 400.http
|
||||||
|
- 403.http
|
||||||
|
- 404.http
|
||||||
|
- 408.http
|
||||||
|
- 500.http
|
||||||
|
- 502.http
|
||||||
|
- 503.http
|
||||||
|
- 504.http
|
||||||
config:
|
config:
|
||||||
dir: /etc/haproxy
|
dir: /etc/haproxy
|
||||||
configfile: haproxy.cfg
|
configfile: haproxy.cfg
|
||||||
|
9
states/haproxy/errors/400.http
Normal file
9
states/haproxy/errors/400.http
Normal 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>
|
||||||
|
|
9
states/haproxy/errors/403.http
Normal file
9
states/haproxy/errors/403.http
Normal 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>
|
||||||
|
|
9
states/haproxy/errors/404.http
Normal file
9
states/haproxy/errors/404.http
Normal 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>
|
||||||
|
|
9
states/haproxy/errors/408.http
Normal file
9
states/haproxy/errors/408.http
Normal 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>
|
||||||
|
|
9
states/haproxy/errors/500.http
Normal file
9
states/haproxy/errors/500.http
Normal 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>
|
||||||
|
|
9
states/haproxy/errors/502.http
Normal file
9
states/haproxy/errors/502.http
Normal 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>
|
||||||
|
|
24
states/haproxy/errors/503.http
Normal file
24
states/haproxy/errors/503.http
Normal 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’ll be back soon!</h1>
|
||||||
|
<div>
|
||||||
|
<p>Sorry for the inconvenience but we’re performing some maintenance at the moment. If you need to you can always <a href="mailto:#">contact us</a>, otherwise we’ll be back online shortly!</p>
|
||||||
|
<p>— The Team</p>
|
||||||
|
</div>
|
||||||
|
</article>
|
||||||
|
|
9
states/haproxy/errors/504.http
Normal file
9
states/haproxy/errors/504.http
Normal 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>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user