Skip to content

Instantly share code, notes, and snippets.

@JeffMelton
Last active November 22, 2017 22:01
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 JeffMelton/571bd689706f4a0a045c54a97a3db691 to your computer and use it in GitHub Desktop.
Save JeffMelton/571bd689706f4a0a045c54a97a3db691 to your computer and use it in GitHub Desktop.
attempting to build an haproxy.cfg template for SaltStack
frontend www
bind {{ salt['grains.get']('ip4_interfaces:eth1') | first }}:80
default_backend nginx_pool
backend nginx_pool
balance roundrobin
mode tcp
{% for server, addr in salt['mine.get']('minion[2,3]', 'network.ip_addrs', expr_form='compound').items() -%}
server {{ server }} {{ addr }}:80 check
{% endfor -%}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment