The lastest patchset of https://review.openstack.org/393361 was actually
not working.
The `if defined` idiom depends on *evaluation* order.
At the time it's red in the haproxy.pp class, the line that loads the
class 'haproxy' has still not yet been reached and thus the `defined`
result is false. The constraint is not added.
For this reason, the use of `defined` in module is not advised by
puppetlabs[1].
[1] https://docs.puppet.com/puppet/latest/reference/function.html#defined
Change-Id: Ibd352cb313f8863d62db8987419378bed5b87256
Relates-To: #
1638029
# This code will be removed once we switch undercloud and overcloud to use both haproxy & keepalived roles.
if $keepalived {
include ::tripleo::keepalived
+ # Make sure keepalive starts before haproxy.
+ Class['::keepalived::service'] -> Class['::haproxy']
}
# TODO(bnemec): When we have support for SSL on private and admin endpoints,
priority => 101,
}
}
- # Make sure keepalive starts before haproxy.
- if (defined(Class['::haproxy'])) {
- Class['::keepalived::service'] -> Class['::haproxy']
- }
}