diff --git a/boost-proxy/tasks/haproxy.yml b/boost-proxy/tasks/haproxy.yml index 29431f64..477ec29f 100644 --- a/boost-proxy/tasks/haproxy.yml +++ b/boost-proxy/tasks/haproxy.yml @@ -32,10 +32,12 @@ - haproxy - config -- name: Maintenance file is present +- name: "Copy error pages" copy: - src: "templates/haproxy/maintenance.http" - dest: /etc/haproxy/errors/maintenance.http + src: "templates/haproxy/static/" + dest: "/etc/haproxy/errors/" + owner: root + group: root mode: "0644" notify: reload haproxy tags: diff --git a/boost-proxy/tasks/site.yml b/boost-proxy/tasks/site.yml index 7f4cc870..e8cd1d2c 100644 --- a/boost-proxy/tasks/site.yml +++ b/boost-proxy/tasks/site.yml @@ -2,16 +2,13 @@ # HAProxy -- name: "Copy custom error pages for {{ site }}" - template: - src: "{{ template }}" +- name: "Copy HAProxy static elements for {{ site }}" + copy: + src: "templates/boost-sites/{{ site }}/haproxy/static/" dest: "/etc/haproxy/sites/{{ site }}/" owner: root group: root mode: "0644" - loop: "{{ query('fileglob', 'templates/boost-sites/{{ site }}/haproxy/*.http') }}" - loop_control: - loop_var: template tags: - haproxy - config @@ -19,7 +16,7 @@ # Varnish -- name: "Copy sites custom VCL config for {{ site }}" +- name: "Copy Varnish custom VCL for {{ site }}" template: src: "templates/boost-sites/{{ site }}/varnish/default.vcl.j2" dest: "/etc/varnish/sites/{{ site }}.vcl" diff --git a/boost-proxy/templates-examples/boost-sites/000-example/haproxy/frontend_external.j2 b/boost-proxy/templates-examples/boost-sites/000-example/haproxy/frontend_external.j2 index d407faa7..4e3b604b 100644 --- a/boost-proxy/templates-examples/boost-sites/000-example/haproxy/frontend_external.j2 +++ b/boost-proxy/templates-examples/boost-sites/000-example/haproxy/frontend_external.j2 @@ -1,6 +1,6 @@ acl example_domains var(req.hdr_host) -m str example.com acl example_domains2 var(req.hdr_host) -m str example.org www.example.org - ### acl example_maintenance_ips src -f /etc/haproxy/example/maintenance_ips + ### acl example_maintenance_ips src -f /etc/haproxy/sites/{{ site }}/maintenance_ips # Redirect to HTTPS without Let's Encrypt certificate ### http-request redirect scheme https code 301 if example_domains !{ ssl_fc } diff --git a/boost-proxy/templates-examples/boost-sites/000-example/haproxy/maintenance.http b/boost-proxy/templates-examples/boost-sites/000-example/haproxy/static/maintenance.http similarity index 100% rename from boost-proxy/templates-examples/boost-sites/000-example/haproxy/maintenance.http rename to boost-proxy/templates-examples/boost-sites/000-example/haproxy/static/maintenance.http diff --git a/boost-proxy/templates-examples/haproxy/400.http b/boost-proxy/templates-examples/haproxy/static/400.http similarity index 100% rename from boost-proxy/templates-examples/haproxy/400.http rename to boost-proxy/templates-examples/haproxy/static/400.http diff --git a/boost-proxy/templates-examples/haproxy/403.http b/boost-proxy/templates-examples/haproxy/static/403.http similarity index 100% rename from boost-proxy/templates-examples/haproxy/403.http rename to boost-proxy/templates-examples/haproxy/static/403.http diff --git a/boost-proxy/templates-examples/haproxy/404.http b/boost-proxy/templates-examples/haproxy/static/404.http similarity index 100% rename from boost-proxy/templates-examples/haproxy/404.http rename to boost-proxy/templates-examples/haproxy/static/404.http diff --git a/boost-proxy/templates-examples/haproxy/500.http b/boost-proxy/templates-examples/haproxy/static/500.http similarity index 100% rename from boost-proxy/templates-examples/haproxy/500.http rename to boost-proxy/templates-examples/haproxy/static/500.http diff --git a/boost-proxy/templates-examples/haproxy/502.http b/boost-proxy/templates-examples/haproxy/static/502.http similarity index 100% rename from boost-proxy/templates-examples/haproxy/502.http rename to boost-proxy/templates-examples/haproxy/static/502.http diff --git a/boost-proxy/templates-examples/haproxy/503.http b/boost-proxy/templates-examples/haproxy/static/503.http similarity index 100% rename from boost-proxy/templates-examples/haproxy/503.http rename to boost-proxy/templates-examples/haproxy/static/503.http diff --git a/boost-proxy/templates-examples/haproxy/504.http b/boost-proxy/templates-examples/haproxy/static/504.http similarity index 100% rename from boost-proxy/templates-examples/haproxy/504.http rename to boost-proxy/templates-examples/haproxy/static/504.http diff --git a/boost-proxy/templates-examples/haproxy/maintenance.http b/boost-proxy/templates-examples/haproxy/static/maintenance.http similarity index 100% rename from boost-proxy/templates-examples/haproxy/maintenance.http rename to boost-proxy/templates-examples/haproxy/static/maintenance.http