This commit uses a keepalived role, available in
ansible galaxy, to configure keepalived for haproxy
Keepalived makes the haproxy truely HA, by having
haproxy's VIP highly available between the hosts
defined in the inventory.
The keepalived role configuration is fully
documented on the upstream role.
To configure keepalived on your host, you only have to
give it a variable (dict). A template handles the
generation of the configuration of keepalived.
By default, the variable files defined in vars/configs/
are enough to have a keepalived working for haproxy,
with a master-backup configuration.
You can define other variable files by setting
haproxy_keepalived_(master|backup)_vars in your
user_variables. This should point to a "variable
template" file like the one you can find
in vars/configs/*
The haproxy playbook has been changed to rely on
the dynamic generation script. It will use the env.d
to have haproxy hosts. The first host from the
generated inventory will be considered as master,
while the others are slaves. The keepalived role
will only run if more than haproxy host is found
in the inventory. This behaviour can be changed
and keepalived can be disabled by the variable:
haproxy_use_keepalived.
The implemented variables are the following:
* haproxy_keepalived_(ext|int)ernal_vip_cidr
* haproxy_keepalived_(ext|int)ernal_interface
* haproxy_keepalived_(ext|int)ernal_virtual_router_id
* haproxy_keepalived_priority_backup
* haproxy_keepalived_priority_master
* haproxy_keepalived_vars_file
In these variables, only the following variables
are necessary: keepalived_(ext|int)ernal_vip_cidr
However, it's recommended to also configure the
keepalived_(ext|int)ernal_interface
(to know which interface the vips can bind on)
Reviewed: https:/ /review. openstack. org/218818 /git.openstack. org/cgit/ openstack/ openstack- ansible/ commit/ ?id=a239b29baf2 1dc09570b55f45d 86f70581841602
Committed: https:/
Submitter: Jenkins
Branch: master
commit a239b29baf21dc0 9570b55f45d86f7 0581841602
Author: Jean-Philippe Evrard <email address hidden>
Date: Mon Aug 31 13:44:46 2015 +0200
Implementation of keepalived for haproxy
This commit uses a keepalived role, available in
ansible galaxy, to configure keepalived for haproxy
Keepalived makes the haproxy truely HA, by having
haproxy's VIP highly available between the hosts
defined in the inventory.
The keepalived role configuration is fully
documented on the upstream role.
To configure keepalived on your host, you only have to
give it a variable (dict). A template handles the
generation of the configuration of keepalived.
By default, the variable files defined in vars/configs/
are enough to have a keepalived working for haproxy,
with a master-backup configuration.
You can define other variable files by setting keepalived_ (master| backup) _vars in your
haproxy_
user_variables. This should point to a "variable
template" file like the one you can find
in vars/configs/*
The haproxy playbook has been changed to rely on use_keepalived.
the dynamic generation script. It will use the env.d
to have haproxy hosts. The first host from the
generated inventory will be considered as master,
while the others are slaves. The keepalived role
will only run if more than haproxy host is found
in the inventory. This behaviour can be changed
and keepalived can be disabled by the variable:
haproxy_
The implemented variables are the following: keepalived_ (ext|int) ernal_vip_ cidr keepalived_ (ext|int) ernal_interface keepalived_ (ext|int) ernal_virtual_ router_ id keepalived_ priority_ backup keepalived_ priority_ master keepalived_ vars_file
* haproxy_
* haproxy_
* haproxy_
* haproxy_
* haproxy_
* haproxy_
In these variables, only the following variables (ext|int) ernal_vip_ cidr (ext|int) ernal_interface
are necessary: keepalived_
However, it's recommended to also configure the
keepalived_
(to know which interface the vips can bind on)
Closes-Bug: 1414397 7ac9356e8a28fe4 b5936eb9334
Change-Id: Ib87a3bb70d6f4b