Commit Graph

17 Commits

Author SHA1 Message Date
Liam Young 679a76dfe5 Move common requires code
Move common requires code in to the common module so that
requires.py only contains the code which is specific to
reactive charms. This will allow for a subsequent patch which
creates a requires interface consumable by operator framework
charms.

Change-Id: I70037252cc7a677a9394929cb0cd17e9506ab624
2021-08-26 12:03:41 +00:00
José Pekkarinen 4baae7a0f2
Control access to crm in cases when the unit is yet not
having any corosync resource available.

Closes-bug: #1864804
Change-Id: I6eb3b9a816a93c4c7894e17935b1e7c8604592c5
Signed-off-by: José Pekkarinen <jose.pekkarinen@canonical.com>
2020-03-03 19:43:50 +02:00
Mike Wilson e1d44c258a Add support for systemd
Systemd support is in corosync, but currently the add_init_service
handles adding an upstart service only. This results in Charmed
Kubernetes having incorrectly monitored services.

Change-Id: I935613292ce6b78cf645469fda6d21b0aa695c28
Closes-Bug: #1843933
2019-09-13 14:11:07 -04:00
Mike Wilson a4b62a9a00 Adding support for deletion of vip, dns, and init services.
Change-Id: I6b0f00aaf7e3c83e1a35ed1ecb4127f743aeba6d
2019-02-15 10:34:57 -05:00
Liam Young 087ddb3936 Add ability for charms to delete crm resources
Change-Id: I407b40fe154a30de6e607849126d71fbc99fd158
2018-12-18 08:24:28 +00:00
Liam Young ad21b5daed Make specifying the nic optional
If a nic is not specified when setting up a vip resource then
corosync should just do the right thing. This change makes the nic
field optional as there is little benefit in using it.

Change-Id: I022a43df0a50a21df3c5f021dcd563da4d20db53
2018-04-17 10:18:53 +00:00
James Page 8c72945ead py3: sort CRM group members
Ensure that CRM group members are sorted to avoid continual
data mutation on ha relations to the hacluster charm, which
causes restarts of services and vips.

Change-Id: I80ca19fa5f1d573827ea9cd7fe0f18c575518c8c
Closes-Bug: 1754149
2018-03-22 11:14:30 +00:00
David Ames bf858a38bc Do not set ha.available until clustered
The interface was setting ha.available immediately with no gating.

The hacluster charm sets a relation variable, clustered, when it has
enough peers and has setup corosync. This change updates the
interface to react to this setting. Only set ha.available when
clustered is set and True.

Change-Id: I23eb5e70537a62d5b9e5e24d09f37519b63a1717
Closes-Bug: #1749280
2018-02-28 19:41:00 +00:00
James Page 52a760b8fb Pass data over interface using json keys
Switch to using json encoded data when passing configuration
to the hacluster charm.

Note that this requires an up-to-date version of the hacluster
charm, but ensures that data is presented consistently over the
relation due to deterministic encoding using json.

Change-Id: If2ace4b37f4152bf8bc44526b609a034433efc67
Closes-Bug: 1741304
2018-01-05 12:19:02 +00:00
Liam Young 09ead5622e Add functions for managing DNS Entries
Add code for managing DNS Entries via hacluster. This is part of the
effort to enable DNS HA in the reactive charms.

Change-Id: I1a6cdeffa3aa8657b957ba68cd09face27f93b27
Partial-Bug: #1727376
2017-10-26 21:47:26 +01:00
David Ames c01416b7eb Ensure only VIP resources are in vip group
Fix bug I intrduces in:
77c2b25407
Where the haproxy resource was also added to vip group.

Ensure only VIP resources are added to the vip group.

Change-Id: Ie6b4ae89af74151ebb435c72a6df78174bbec87b
2017-08-21 14:48:32 -07:00
David Ames 77c2b25407 Dualstack IPv4/IPv6 support
Allow for two VIPs on a single interface as in IPv4/IPv6 dual
stack scenarios.

Add missing group membership for VIPs.

Change-Id: Ieba9fd453efcd3d407baaeb8d0d6f3f71750060e
2017-08-17 15:47:13 -07:00
Alex Kavanagh e4743dd143 Enable the hascluster interface to do less juju work
This change stops the requires side of the interface (in a reactive
charm) from setting data on the relation that's already been set.
This has the effect of not asking hacluster to do something every time
a reactive charm (e.g. designate) does update status.

Change-Id: I750f3c41a2f0447a47cfd19bab1d4958de4577f2
Related-Bug: #1708396
2017-08-07 16:49:41 +01:00
James Page e73c63464f Add clones to interface as well for charm use 2016-06-21 12:53:18 +01:00
Liam Young 3e1adbf909 Added docstring, lint fixes and general tidyup 2016-06-08 14:03:50 +00:00
Liam Young e5f2140cf5 Add more common code
Add methods for setting up hacluster resources in interface to allow external
code to cleanly call <interface>.add_<resource> rather than having to import
specific methods from common.py
2016-06-01 11:03:43 +00:00
Billy Olsen a73846f575 First commit of the proposed hacluster interface.
This commit includes a rough implementation of the hacluster
interface which allows a charm to interact with the hacluster
subordintate charm.
2016-01-05 21:22:27 -07:00