Skip to content

Create and populate the errors directory #22

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
1 commit merged into from
Apr 15, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions files/400.http
Original file line number Diff line number Diff line change
@@ -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 changes: 9 additions & 0 deletions files/403.http
Original file line number Diff line number Diff line change
@@ -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 changes: 9 additions & 0 deletions files/408.http
Original file line number Diff line number Diff line change
@@ -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 changes: 9 additions & 0 deletions files/500.http
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
HTTP/1.0 500 Server Error
Cache-Control: no-cache
Connection: close
Content-Type: text/html

<html><body><h1>500 Server Error</h1>
An internal server error occured.
</body></html>

9 changes: 9 additions & 0 deletions files/502.http
Original file line number Diff line number Diff line change
@@ -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>

9 changes: 9 additions & 0 deletions files/503.http
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
HTTP/1.0 503 Service Unavailable
Cache-Control: no-cache
Connection: close
Content-Type: text/html

<html><body><h1>503 Service Unavailable</h1>
No server is available to handle this request.
</body></html>

9 changes: 9 additions & 0 deletions files/504.http
Original file line number Diff line number Diff line change
@@ -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>

42 changes: 42 additions & 0 deletions tasks/configure.yml
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,48 @@
with_items: "{{ haproxy_userlists }}"
when: haproxy_userlists is defined

## CREATE ERROR PAGES

- name: Add error directory
file:
path: "{{ haproxy_config_dir }}/errors"
state: directory

- name: Ensure http 400 error file is present
copy:
src: 400.http
dest: "{{ haproxy_config_dir }}/errors/400.http"

- name: Ensure http 403 error file is present
copy:
src: 403.http
dest: "{{ haproxy_config_dir }}/errors/403.http"

- name: Ensure http 408 error file is present
copy:
src: 408.http
dest: "{{ haproxy_config_dir }}/errors/408.http"

- name: Ensure http 500 error file is present
copy:
src: 500.http
dest: "{{ haproxy_config_dir }}/errors/500.http"

- name: Ensure http 502 error file is present
copy:
src: 502.http
dest: "{{ haproxy_config_dir }}/errors/502.http"

- name: Ensure http 503 error file is present
copy:
src: 503.http
dest: "{{ haproxy_config_dir }}/errors/503.http"

- name: Ensure http 504 error file is present
copy:
src: 504.http
dest: "{{ haproxy_config_dir }}/errors/504.http"

## ASSEMBLE CONFIG - GLOBAL & DEFAULT

- name: 'Delete the compiled folder'
Expand Down