Commit Graph

4 Commits

Author SHA1 Message Date
Damien Ciabrini
f5d6110a79 Fix keepalived VIP monitoring script
Currently keepalived monitors VIPs by running some shell commands
that target HAProxy. The generated shell command is invalid, which
makes keepalived log errors.

Tue Apr 16 11:55:57 2019:    Command = '/usr/bin/test' '-S' '/var/lib/haproxy/stats' '&&' 'echo' 'show'
Tue Apr 16 11:55:57 2019: Script `haproxy` now returning 2
Tue Apr 16 11:55:57 2019: VRRP_Script(haproxy) failed (exited with status 2)

Fix quoting and invoke /bin/sh explicitely to fix the error:

Thu Apr 18 13:16:35 2019:    Command = '/usr/bin/sh' '-c' 'test -S /var/lib/haproxy/stats && echo show info | socat /var/lib/haproxy/stats stdio'
Thu Apr 18 13:16:35 2019: VRRP_Script(haproxy) succeeded

Change-Id: I5a757f88963270e77c8ec411cd292a30f89c6bc0
Closes-Bug: #1825366
2019-04-18 11:47:10 -06:00
Alex Schultz
8d889af7d4 Update functions to fix unit tests
With the release of 5.5.7, some of the legacy function definitions no
longer pass in unit tests. This change updates the functions that are
failing in the tests to the modern style (4.x) for function
declarations.  Additionally we're removing teh lookup_hiera_hash
function which is failing but not actually consumed by our code base.

There will be a followup patch to migrate the rest of the parser
functions to the new format, but this patch should unblock the gates.

NOTE: git thinks some of these files have been added/deleted rather than
git move due to the large amount of changes between the two versions of
the file.

Change-Id: Ie7316fd422bd4a5eb91f94016977e5d8d76c27bc
Closes-Bug: #1799786
2018-10-29 12:16:38 +01:00
Cédric Jeanneret
50ce48cd28 Correct vrrp script for haproxy status
Currently, on a containerized undercloud, we get error messages from
keepalived container:
/usr/bin/systemctl status haproxy.service exited with status 1

Even if the undercloud is currently not in HA, it's still a good thing
to get clean logs.

Note: the command is launched by the keepalived container, hence we
cannot use pgrep nor anything else. We also need the /var/lib/haproxy
mount in the keepalived container, shared from the haproxy container on
the host.

Change-Id: Ib5050a3a6af262e26b5523974d1d4a80c4e92834
2018-07-23 17:06:29 +02:00
Alex Schultz
e083f248a9 Add tests for tripleo::keepalived
This change adds test coverage for the tripleo::keepalived class
and exposes the ability to pass network_vips as a parameter rather than
just via hiera.

Change-Id: Ied2f26f6bfdcd9c4fe85f08461b997c15c66345f
2018-02-06 16:47:22 -07:00