Template created to install haproxy

This commit is contained in:
2016-02-02 08:55:27 -05:00
parent d3c83613bb
commit 5f0e4b24e8
2 changed files with 15 additions and 1 deletions

View File

@@ -0,0 +1,14 @@
---
#This playbook will install haproxy and configure for rails servers
#
- name: update apt cache
apt: update_cache=yes cache_valid_time=3600
- name: install haproxy
apt: name=haproxy state=present
- name: Create haproxy config file
template: src=haproxy.cfg.j2 dest=/etc/haproxy/haproxy.cfg
- name: Restart haproxy
service: name=haproxy state=restarted

View File

@@ -21,7 +21,7 @@ listen mysql-cluster
mode tcp mode tcp
option mysql-check user haproxy_check option mysql-check user haproxy_check
balance roundrobin balance roundrobin
{% for db_server in db-internal-ips %} {% for db_server in masterdb-internal %}
server {{ db_server }} {{ db_server }}:3306 check server {{ db_server }} {{ db_server }}:3306 check
{% endfor %} {% endfor %}