diff --git a/states/haproxy/map.jinja b/states/haproxy/map.jinja index 8b6a766..1feb7c7 100644 --- a/states/haproxy/map.jinja +++ b/states/haproxy/map.jinja @@ -7,6 +7,7 @@ {%- set users = salt['pillar.get']('htpasswds') -%} {%- set net = salt['pillar.get']('net') -%} {%- set fqdn = salt['grains.get']('fqdn') -%} +{%- set country = salt['grains.get']('country') -%} {% set peers_ip = [] %} {%- for k,v in haproxy.peers.items() %} diff --git a/states/haproxy/templates/haproxy.cfg.j2 b/states/haproxy/templates/haproxy.cfg.j2 index d350d46..1b7acd4 100644 --- a/states/haproxy/templates/haproxy.cfg.j2 +++ b/states/haproxy/templates/haproxy.cfg.j2 @@ -1,5 +1,5 @@ ## {{ salt['pillar.get']('salt_managed', default='Salt Managed') }} -{%- from "haproxy/map.jinja" import haproxy,certs,fqdn with context %} +{%- from "haproxy/map.jinja" import haproxy,fqdn,country with context %} {%- set ns = namespace(default_backend='notdefined') %} {%- for name, values in haproxy.config.vhosts.items() %}{% if values.default_backend|default(false) %}{% set ns.default_backend = name %}{% endif %}{% endfor %} @@ -93,6 +93,7 @@ global server-state-file /var/run/haproxy.state mworker-max-reloads 2 maxconn 1000 + set-var proc.country str('{{ country }}') lua-prepend-path {{ haproxy.config.dir }}/mods/?.so cpath lua-prepend-path {{ haproxy.config.dir }}/scripts/?.lua {%- for script,params in haproxy.config.scripts.items() %} @@ -175,7 +176,7 @@ frontend fe_http from {{ haproxy.config.namespace }} ## Returns http-request return status 200 content-type text/plain string "User-agent: *\r\nAllow: /" if robots_txt http-request return status 200 content-type text/plain string "Contact: mailto:{{ haproxy.config.syscontact }}" if security_txt - http-request return status 200 content-type "text/html; charset=utf-8" lf-string "
host: %H