Set default keepalived cidr if none is provided

Even if this file is completely ignored because the role using it
is skipped, ansible parses the whole file. Any undefined variables
will cause a failure. Undefined variable was previously a way to
force failure if it was undefined, but now we have to do differently.

In the meantime, this is a quick fix to make sure we don't have
issues with undefined variables for non-multinode haproxy installs.

Change-Id: Ifd00f4eb0a0a3559d7d3bd3c5a4331798a3c96aa
Closes-Bug: 1631920
This commit is contained in:
Jean-Philippe Evrard 2016-10-11 16:50:31 +01:00 committed by Jesse Pretorius (odyssey4me)
parent 8b400611a8
commit 3b1647c708
2 changed files with 11 additions and 2 deletions

View File

@ -50,7 +50,7 @@ keepalived_instances:
priority: "{{ ((play_hosts|length-play_hosts.index(inventory_hostname))*100)-((play_hosts|length-play_hosts.index(inventory_hostname))*50) }}"
authentication_password: "{{ haproxy_keepalived_authentication_password }}"
vips:
- "{{ haproxy_keepalived_external_vip_cidr }} dev {{ haproxy_keepalived_external_interface | default(management_bridge) }}"
- "{{ haproxy_keepalived_external_vip_cidr | default('169.254.1.1/24') }} dev {{ haproxy_keepalived_external_interface | default(management_bridge) }}"
track_scripts:
- haproxy_check_script
- pingable_check_script
@ -64,4 +64,4 @@ keepalived_instances:
- haproxy_check_script
- pingable_check_script
vips:
- "{{ haproxy_keepalived_internal_vip_cidr }} dev {{ haproxy_keepalived_internal_interface | default(management_bridge) }}"
- "{{ haproxy_keepalived_internal_vip_cidr | default('169.254.2.1/24') }} dev {{ haproxy_keepalived_internal_interface | default(management_bridge) }}"

View File

@ -0,0 +1,9 @@
---
issues:
- The variables
``haproxy_keepalived_(internal|external)_cidr`` now has a default
set to ``169.254.(2|1).1/24``. This is to prevent Ansible
undefined variable warnings.
Deployers must set values for these variables for a working
haproxy with keepalived environment when using more than one
haproxy node.