added missing haproxy_config file

This commit is contained in:
Jedrzej Nowak 2015-09-01 16:07:20 +02:00
parent 631e3a4b96
commit e7f7eded96

View File

@ -0,0 +1,22 @@
# TODO
- hosts: [{{ip}}]
sudo: yes
vars:
config_dir: {src: {{ config_dir.value['src'] }}, dst: {{ config_dir.value['dst'] }}}
haproxy_ip: {{ ip }}
haproxy_services:
{% for service, ports, listen_port, protocol in zip(configs.value, configs_ports.value, listen_ports.value, configs_protocols.value) %}
- name: {{ service['emitter_attached_to'] }}
listen_port: {{ listen_port['value'] }}
protocol: {{ protocol['value'] }}
servers:
{% for server_ip, server_port in zip(service['value'], ports['value']) %}
- name: {{ server_ip['emitter_attached_to'] }}
ip: {{ server_ip['value'] }}
port: {{ server_port['value'] }}
{% endfor %}
{% endfor %}
tasks:
- file: path={{ config_dir.value['src'] }}/ state=directory
- file: path={{ config_dir.value['src'] }}/haproxy.cfg state=touch
- template: src={{ resource_dir }}/templates/haproxy.cfg dest=/etc/haproxy/haproxy.cfg