Skip to content
Snippets Groups Projects
Commit 44068f8d authored by jurgenhaas's avatar jurgenhaas
Browse files

ansible-inventories/arocom#108 Allow support for external hosts in HaProxy

parent cc3e4ed8
No related branches found
No related tags found
No related merge requests found
#HaProxy# # Instruction to prepare a certificate file
##Instruction to prepare a certificate file##
For HaProxy to terminate SSL requests we require a single PEM file with all certificate components chained together. For HaProxy to terminate SSL requests we require a single PEM file with all certificate components chained together.
......
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
mode=644 mode=644
state=touch state=touch
with_items: '{{ groups.all }}' with_items: '{{ groups.all }}'
notify: 'Proxy | Restart HAProxy' changed_when: false
- name: "Proxy | Create config file" - name: "Proxy | Create config file"
template: src=haproxy_cfg template: src=haproxy_cfg
......
...@@ -110,6 +110,10 @@ frontend https_in_{{ cert.ip }} ...@@ -110,6 +110,10 @@ frontend https_in_{{ cert.ip }}
acl kibana_present hdr(host) -i -n '{{ kibana_domain|default(inventory_hostname) }}' acl kibana_present hdr(host) -i -n '{{ kibana_domain|default(inventory_hostname) }}'
use_backend backend_kibana if kibana_present use_backend backend_kibana if kibana_present
{% endif %} {% endif %}
{% for external in cert.external|default([]) %}
acl is_{{ external.key }} {{ external.acl }}
use_backend backend_{{ external.key }} if is_{{ external.key }}
{% endfor %}
{% if varnish_host|default(false) %} {% if varnish_host|default(false) %}
acl static_content path_end .jpg .jpeg .gif .png .ico .swf .css .js .htm .html 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
...@@ -124,6 +128,11 @@ frontend https_in_{{ cert.ip }} ...@@ -124,6 +128,11 @@ frontend https_in_{{ cert.ip }}
use_backend backend_redirect if crm_redirect_{{host}} use_backend backend_redirect if crm_redirect_{{host}}
{% endif %} {% endif %}
{% endfor %} {% endfor %}
{% for external in cert.external|default([]) %}
backend backend_{{ external.key }}
server server_{{ external.key }} {{ external.server }} maxconn 100
{% endfor %}
{% endfor %} {% endfor %}
{% for host in groups['all'] %} {% for host in groups['all'] %}
......
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