Skip to content

Instantly share code, notes, and snippets.

@Zodzie
Last active August 26, 2018 18:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Zodzie/c43fbf4e261b18b2c3bdf1cc7bf49e41 to your computer and use it in GitHub Desktop.
Save Zodzie/c43fbf4e261b18b2c3bdf1cc7bf49e41 to your computer and use it in GitHub Desktop.
template_actions
{% for host in groups['users'] %}
acl {{ hostvars[host].username }} path_reg -i ^\/{{ hostvars[host].username }}[^\.]*
use_backend {{ hostvars[host].username }}_back if {{ hostvars[host].username }}
{% endfor %}
{% if hostvars[host].subscription == 'pro' %}
acl {{ hostvars[host].username }} hdr(host) -i {{ hostvars[host].username }}.com
use_backend {{ hostvars[host].username}}_back if {{ hostvars[host].username }}
{% endif %}
{% for host in groups['users'] %}
backend {{ hostvars[host].username }}_back
redirect scheme https if !{ ssl_fc }
server somewhere server.ip.add.ress:{{ hostvars[host].user_port }}
{% endfor %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment