Skip to content
Snippets Groups Projects
Commit 79bfcae3 authored by jurgenhaas's avatar jurgenhaas
Browse files

ansible-inventories/arocom#143 Allow domains to ignore Varnish

parent d21c3e07
No related branches found
No related tags found
No related merge requests found
......@@ -29,6 +29,15 @@
with_items: '{{ groups.all }}'
notify: 'Proxy | Restart HAProxy'
- name: "Proxy | Create ignore varnish host lists"
template:
src='ignore_varnish_list'
dest='/etc/haproxy/ignore_varnish.list'
owner='root'
group='root'
mode='644'
notify: 'Proxy | Restart HAProxy'
- name: "Proxy | Create empty crm lists files"
file:
dest='/etc/haproxy/{{item}}.crm.list'
......
......@@ -84,8 +84,9 @@ frontend http_in
use_backend backend_redirect_ssl if kibana_present
{% endif %}
{% if varnish_host|default(false) %}
acl domain_ignores_varnish hdr(host) -i -n -f /etc/haproxy/ignore_varnish.list
acl static_content path_end .jpg .jpeg .gif .png .ico .swf .css .js .htm .html
use_backend backend_varnish if static_content
use_backend backend_varnish if static_content !domain_ignores_varnish
{% endif %}
{% for host in groups['all'] %}
acl domain_in_{{host}} hdr(host) -i -n -f /etc/haproxy/{{host}}.list
......@@ -137,8 +138,9 @@ frontend https_in_{{ cert.ip }}
use_backend backend_{{ external.key }} if is_{{ external.key }}
{% endfor %}
{% if varnish_host|default(false) %}
acl domain_ignores_varnish hdr(host) -i -n -f /etc/haproxy/ignore_varnish.list
acl static_content path_end .jpg .jpeg .gif .png .ico .swf .css .js .htm .html
use_backend backend_varnish if static_content
use_backend backend_varnish if static_content !domain_ignores_varnish
{% endif %}
{% for host in groups['all'] %}
acl ssl_domain_in_{{host}} hdr(host) -i -n -f /etc/haproxy/{{host}}.ssl.list
......
{% for item in groups.all %}
{% for domain in hostvars[item].proxy_domains_ignore_varnish|default([]) %}
{{domain}}
{% endfor %}
{% for drupal in hostvars[item].drupal_settings|default([]) %}
{% for domain in drupal.domains|default([]) %}
{% if domain.ignore_varnish|default(false) %}
{{domain.domain}}
{% endif %}
{% endfor %}
{% endfor %}
{% endfor %}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment