3 Commits

Author SHA1 Message Date
Jean-Philippe Evrard
ae99efd64c Adding modularity to keepalived configuration
This patch introduces modularity into the default keepalived
configuration: Currently, keepalived uses a ping to check its
alive status. The IP was hard setted in the configuration file.

This patch introduces multiple variables:
- keepalived_ping_address
- keepalived_ping_count
- keepalived_ping_interval

The one probably used the most will be the
``keepalived_ping_address``. It's therefore listed in
``user_variables`` with the other keepalived variables.

Fixes-Bug: #1570420

Change-Id: Ic9a591fe739dd4ee3b0ad0130190e000404fb73a
2016-04-18 08:40:18 -05:00
Jean-Philippe Evrard
12a3fbafd0 Fixing keepalived bug when 2+ backup nodes have the same priority
The issue is present if you're running 2 or more nodes with
a keepalived < 1.2.8. This bumps the version of keepalived role
(installing a more recent version of keepalived by default) AND
edits the keepalived configuration file to avoid having nodes
with the same priority.

This will restart your keepalived service.

Please note this commit is not meant for backporting. The deployer
running on mitaka and below should follow the documentation here:
https://review.openstack.org/#/c/279664/

Bug: #1545066

Change-Id: Ie28d2d3fa8670212c64ecbdf5a87314e7ca0a2d9
2016-04-13 12:05:32 +00:00
Jean-Philippe Evrard
a239b29baf
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
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)

Closes-Bug: 1414397
Change-Id: Ib87a3bb70d6f4b7ac9356e8a28fe4b5936eb9334
2015-10-07 23:08:41 -05:00