Commit Graph

498 Commits

Author SHA1 Message Date
Zuul 871f551e21 Merge "Get private-address for local unit from relation" 2023-10-03 15:20:00 +00:00
Tiago Pasqualini 71100249ee Get private-address for local unit from relation
Currently, the private-address for the local unit is queried using
unit_get, which can cause it to return an address from a different
binding. This patch changes it to always query from the relation.

Closes-bug: #2020669
Change-Id: I128420c572d5491b9af4cf34614f4534c787d02c
2023-09-21 11:00:34 -03:00
Peter Matulis 058d26b16a Add docs key and point at Discourse
Add the 'docs' key and point it at a Discourse topic
previously populated with the charm's README contents.

When the new charm revision is released to the Charmhub,
this Discourse-based content will be displayed there. In
the absense of the this new key, the Charmhub's default
behaviour is to display the value of the charm's
'description' key.

Change-Id: Icf59d65f7938a9a72a0dca87dfbcf13118fabea1
2023-08-22 17:13:18 -04:00
Gabriel Cocenza aa557b85b7 Add application version on HA Cluster charm
Closes-Bug: #2031438
Change-Id: I4dab721ebe42d4c43c09a98204ce8113892aa817
2023-08-16 11:01:31 -03:00
Felipe Reyes 783a80c119 Use charmcraft 2.x to build
Change-Id: Idbc4684feb56990bf9afe48645c7441c54c426a4
2023-08-10 15:32:35 -04:00
Jadon Naas a127f12516 Fix typo in actions.yaml
There was a typo in actions.yaml for the resume action that was breaking
builds. This change fixes that typo. The charm will build.

Closes-Bug: 2030677
Change-Id: I08dcbec009b392ea0346c2f44a4dd27b2ab90c9c
2023-08-08 20:33:32 -04:00
Corey Bryant b6b29ce894 Add 2023.2 Bobcat support
* sync charm-helpers to classic charms
* change openstack-origin/source default to bobcat
* add mantic to metadata series
* align testing with bobcat
* add new bobcat bundles
* add bobcat bundles to tests.yaml
* add bobcat tests to osci.yaml and .zuul.yaml
* update build-on and run-on bases

Func-Test-Pr: https://github.com/openstack-charmers/zaza-openstack-tests/pull/1062
Change-Id: Ie2fdfae9a2304fd6cb55edd4c1b93f1fdbe4014d
2023-08-03 20:53:48 -04:00
Felipe Reyes 0628e02983 Add kinetic support
Summary of changes:
- add kinetic to metadata.yaml
- add 21.10 to run-on in charmcraft.yaml
- add kinetic-zed testing bundle

Func-Test-Pr: https://github.com/openstack-charmers/zaza-openstack-tests/pull/1014
Related-Bug: #1972730
Change-Id: I28c1f16bdbe2032e678f7c92caee5ddd3fcd4a7f
2023-02-27 15:44:32 -03:00
Felipe Reyes 8446b38347 Use get_property instead of get-property
hacluster uses the command "crm configure get-property <CMD>" to obtain
a property of the cluster, although "get-property" has been deprecated
in favor of "get_property", since crmsh-4.2.1 a warning is printed to
stdout[0] breaking the parsing.

    # crm configure get-property maintenance-mode 2>/dev/null
    WARNING: This command 'get-property' is deprecated, please use 'get_property'
    INFO: "get-property" is accepted as "get_property"
    true

[0] 86282af8e5

Change-Id: Id0ee9ab1873d14dcd1c960001cdeb8318f599ef5
Closes-Bug: #2008704
2023-02-27 11:02:28 -03:00
Felipe Reyes f856ee25ff charm-helpers sync
Sync to pick up changes that include 'kinetic' to the list of known
ubuntu series codenames.

Change-Id: Ie2b1bf9bac3df0631774bb1e9bd62efa2e74bba1
2023-02-23 11:23:24 -03:00
Felipe Reyes 957a292fb8 Upin the versions of tox
Unpin the versions of tox, setuptools, etc. This removes the issue
with tox 4.x breaking the virtualenv dependencies.

Change-Id: I0fee66af4d908b2800154482daa4aa76dee59d4f
Related-Bug: #2002788
2023-02-22 14:02:49 -03:00
Corey Bryant a03b0b2a87 Only return hacluster nodes from list_nodes()
list_nodes() recently had some changes to run 'crm node show'
in jammy+ instead of 'crm node status'. The difference is that
'crm node show' returns the pacemaker-remote nodes in addition
 to the hacluster nodes. This change limits the nodes returned
by list_nodes() to the hacluster nodes (ie. the nodes that
have a node ID).

Closes-Bug: #1995295
Change-Id: Ia405d4270f56c949f79167f8b75c1304b598b918
2022-11-01 15:40:09 +01:00
Zuul 45310a2270 Merge "Update 'crm node show' parsing to trim ': member'" 2022-10-25 21:22:15 +00:00
Corey Bryant f73ca4d52f Update 'crm node show' parsing to trim ': member'
The command 'crm node show' is used on jammy to retrieve the list of
nodes defined in a cluster. The output for nodes includes ': member'
which breaks ensuing commands that are using list_nodes() output.

For example:
juju-3f6cb6-zaza-4135aa8b2509-8.project.serverstack: member

This change trims everything including and after the ':' from the
output.

Closes-Bug: #1994160
Change-Id: I54a4f854f3e293503ec97d99a49b6dc51ee50c87
2022-10-25 19:16:55 +00:00
Felipe Reyes 375060fcf2 Update bundles to use yoga
This change reconfigures the bundles to use OpenStack yoga, the last
version that supports Focal and Jammy.

Change-Id: I8975f04ef03a7a1ff445771bacdb0fc6ed9d8267
Closes-Bug: #1991528
2022-10-17 21:56:32 -03:00
Felipe Reyes 40bb1676b5 Add bindep.txt
bindep.txt allows zuul to install the deb dependencies needed to run the
unittest, these are needed to run py310.

Change-Id: I1f8ef19905d899c32b90ba62c722358f03b54831
2022-10-03 16:34:04 -03:00
Zuul 34c32005fe Merge "Trivial fix for README.md links" 2022-09-05 07:43:03 +00:00
Zuul f31430969a Merge "Revert "Add Kinetic and Zed support"" 2022-09-01 22:51:53 +00:00
Alex Kavanagh 23da3d2257 Revert "Add Kinetic and Zed support"
This reverts commit 527261db5c.

Reason for revert: I'm not sure that this should have been merged; it removes support for focal, and that's needed on the 2.4 branch; thus this couldn't be a clean cherry-pick to the stable/jammy branch.

Change-Id: I5b53d552961d39bda91ef97f425123c1bab7e349
2022-08-31 11:40:07 +00:00
Zuul 1745a606b3 Merge "Add Kinetic and Zed support" 2022-08-30 03:45:13 +00:00
Corey Bryant 527261db5c Add Kinetic and Zed support
* sync charm-helpers to classic charms
* change openstack-origin/source default to zed
* align testing with zed
* add new zed bundles
* add zed bundles to tests.yaml
* add zed tests to osci.yaml and .zuul.yaml
* update build-on and run-on bases
* add bindep.txt for py310
* sync tox.ini and requirements.txt for ruamel
* use charmcraft_channel 2.0/stable
* drop reactive plugin overrides
* move interface/layer env vars to charmcraft.yaml

Change-Id: I1a250a0591c15971840bbd6130c7cff3822eed4f
2022-08-26 18:40:35 +00:00
Felipe Reyes 4e53bea076 Fix 'crm node show' parsing to get list of nodes.
The command 'crm node show' is used on jammy to retrieve the list of
nodes defined in a cluster, although this command also includes the
properties set on a node (e.g. standby=off) which breaks the current
logic parsing.

This change uses a regular expresion to filter out all the lines from
the output that don't start with a non-white character (^\S+).

Change-Id: I3e00daa1b877a7faae1370f08b2d9c5bd7795c5f
Closes-Bug: #1987685
Related-Bug: #1972022
2022-08-25 12:13:33 -04:00
Erhan Sunar fa112b2aa4 Trivial fix for README.md links
Fixed the urls for juju-docs-actions and cdg-ha links.

Change-Id: I20e3c327312e5f579963b6f975271cc9eef992d4
2022-08-15 09:51:35 +00:00
Zuul cf1c3eeeb3 Merge "Drop the use of 'crm node status' on jammy." 2022-06-23 20:58:16 +00:00
Zuul 3acc36209d Merge "Install resource-agents-extra on jammy." 2022-06-23 20:58:04 +00:00
Robert Gildein 920d0ab927 Switch to render from charmhelpers
- add contrib/templating
- using render instead of render_template
- remove render_template function

Change-Id: I395d7dc06618998b9e6023ff649f4aa8c5930cc0
2022-06-01 16:16:17 +02:00
Felipe Reyes 1347ea00c1 Drop the use of 'crm node status' on jammy.
The version of crmsh available on jammy doesn't have the 'crm node
status' subcommand available since it was removed[0], this change uses
the command 'crm node attribute' to figure out if the node is in standby
mode when running on ubuntu>=jammy, and 'crm node show' to get the list
of nodes.

[0] https://github.com/ClusterLabs/crmsh/pull/753

Change-Id: Iafb711be220573cb701527ec84de285edd8942cf
Closes-Bug: #1972022
2022-05-19 10:53:53 -04:00
Zuul 073095a613 Merge "Catch FileExistsError when creating /etc/corosync dir." 2022-05-10 17:28:09 +00:00
Felipe Reyes 32ab2d4bda Install resource-agents-extra on jammy.
The install hooks rsync a set of scripts and one of the destinations
is /usr/lib/stonith/plugins/external, this directory is created by the
installation of the package cluster-glue which is a pulled as an
indirect dependency of pacemaker, this changed on >=jammy where an
intermediate package named resource-agents was split into
resource-agents-base and resource-agents-extra wher the latter doesn't
get installed and it's the one that depends on cluster-glue.

The specific chain of dependencies are:

focal:
pacemaker -> pacemaker-resource-agents -> resource-agents -> cluster-glue

jammy
pacemaker -> pacemaker-resource-agents -> resource-agents-base

Change-Id: Ia00061bff2ebe16d35d52b256c61243935edabba
Closes-Bug: #1971841
2022-05-06 09:55:15 -04:00
Felipe Reyes 715d31e09f Catch FileExistsError when creating /etc/corosync dir.
Hooks are expected to be idempotent, if the install hook for whatever
reason needs to be re-run and the /etc/corosync directory already exists,
because for example it was created in a previous run, the exception
FileExistsError will be raised, this change captures the exception and
moves on.

Change-Id: If43a5c95bb59c9cca7f1a975214a9f013ad6f4d6
Closes-Bug: #1971762
2022-05-05 15:03:58 -04:00
Gabriel Cocenza a0b419519c Fix standby node regex for check_crm
Pacemaker has changed the output format of crm_mon and this broke
the regex to catch nodes that are on standby mode. This change
updates the regex for not alerting on paused units.

Change-Id: I137acad076bff58506fea6e1618a00765adacd9b
Closes-Bug: #1971182
Related-Bug: #1880576
2022-05-02 19:17:36 -03:00
Rodrigo Barbieri d54de3d346 Prevent errors when private-address=None
Whenever a peer returns None as its IP, it results in
misconfiguration in corosync.conf, which results in
a series of cascading hook errors that are difficult to
sort out.

More specifically, this usually happens when network-get
does not work for the current binding. The main problem
is that when changing bindings, a hook fires before the
network-get data is updated. This hook fails and prevents
the network-get from being re-read.

This patch changes the code behavior to ignore None IP
entries, therefore gracefully exiting and deferring further
configuration due to insufficient number of peers when that
happens, so that a later hook can successfully read the IP
from the relation and set the IPs correctly in corosync.

Closes-bug: #1961448
Change-Id: I5ed140a17e184fcf6954d0f66e25f74564bd281c
2022-04-11 16:58:33 -03:00
James Page bbe25222e0 Updates for jammy enablement
- charmcraft: build-on 20.04 -> run-on 20.04/22.04 [*archs]
- Refresh tox targets
- Drop impish bundles and OSCI testing
- Add jammy metadata

Change-Id: I518bc0212fadd3dc78b8bb21d229ee00e6b9a375
2022-04-05 15:37:58 +01:00
Billy Olsen d1191dbcab Render corosync.conf file prior to pkg install
Starting in focal, the ubuntu version of corosync package synced in from
debian includes node1 as the default name for the local node with a nodeid
of 1. This causes the cluster to have knowledge of this extra node1 node,
which affects quorum, etc. Installing the charm's corosync.conf file
before package installation prevents this conditioning from happening.

Additionally this change removes some Xenial bits in the charm and always
includes a nodelist in corosync.conf as it is compulsory in focal and
newer. It is optional in the bionic packages, so we'll always just
render the nodelist.

Change-Id: I06b9c23eb57274f0c99a3a05979c0cabf87c8118
Closes-Bug: #1874719
2022-03-16 08:13:49 -07:00
Alex Kavanagh ecceb52f33 Update to classic charms to build using charmcraft in CI
This update is to ensure that the Zuul Canonical CI builds the charm
before functional tests and ensure that that artifact is used for the
functional tests.  This is to try to ensure that the charm that gets
landed to the charmhub is the same charm that was tested with.

Change-Id: I4ebaac856ddda643804454288961924c1c256aa9
2022-02-15 16:20:13 +00:00
Alex Kavanagh 127d176b2b Migrate charm to charmhub latest/edge track
Change-Id: I5a4bb25ab1a249b5a790695da1baaa32343db568
2022-01-27 20:23:05 +00:00
Hervé Beraud e195794f39 Use unittest.mock instead of mock
The mock third party library was needed for mock support in py2
runtimes. Since we now only support py36 and later, we can use the
standard lib unittest.mock module instead.

Note that https://github.com/openstack/charms.openstack is used during tests
and he need `mock`, unfortunatelly it doesn't declare `mock` in its
requirements so it retrieve mock from other charm project (cross dependency).
So we depend on charms.openstack first and when
Ib1ed5b598a52375e29e247db9ab4786df5b6d142 will be merged then CI
will pass without errors.

Depends-On: Ib1ed5b598a52375e29e247db9ab4786df5b6d142
Change-Id: I631d32e1a330bcd17b53ee873833e8434023958f
2021-12-15 10:32:40 +00:00
Zuul 6b03399205 Merge "Additional test updates" 2021-11-22 14:04:29 +00:00
Corey Bryant 357f995438 Additional test updates
* drop trusty/xenial metadata and function tests
* switch to release-specific zosci functional tests
* switch to yoga zosci unit test job
* add py39

Change-Id: I51ed5c7fdb98dcbea72298da956a66b411fed03f
2021-11-20 08:31:11 -05:00
Alex Kavanagh 67b120ee36 Remove 'jammy' metadata - unblock gate
The charmstore doesn't accept charms with jammy metadata yet.

Change-Id: I7ed399a95fc56fdb4a15e71e585a9be9408636fa
2021-11-12 11:04:02 +00:00
Zuul 435bb56347 Merge "Add yoga bundles and release-tool syncs" 2021-11-11 09:11:34 +00:00
Corey Bryant cc493c3ff5 Add yoga bundles and release-tool syncs
* charm-helpers sync for classic charms
* pin pyparsing for aodhclient
* pin cffi for py35
* add non-voting focal-yoga bundle
* add non-voting jammy-yoga bundle
* add series metadata for jammy
* switch xena bundles to voting
* run focal-ussuri as smoke tests
* remove groovy bundles

Change-Id: I7cce3b8034bcc118cb0765cfb00c050e9c55f847
2021-11-09 10:27:03 -05:00
Rodrigo Barbieri 8fcf7624d9 Fix py35 job
Adding and pinning cffi

Change-Id: Ic6bdb71bdb367de28ffddcae5797ba556971ab25
2021-11-01 14:13:01 -03:00
Alex Kavanagh b4efe9dc4b Add xena bundles
- add non-voting focal-xena bundle
- add non-voting impish-xena bundle
- charm-helpers sync for new charm-helpers changes
- update tox/pip.sh to ensure setuptools<50.0.0

Change-Id: I1f99e0d8e70ce29b647707f7e3b53a59ba93fe05
2021-09-23 14:37:28 +01:00
Stephan Pampel e2249d05e1 Set loglevel of "Pacemaker is ready" to TRACE
Closes-Bug: #1889482
Change-Id: Ie97d09f5bd319a4adf93abd44fc465c77fd20620
2021-08-20 14:41:37 +02:00
Aurelien Lourot f5cf525377 Sync release-tools
In order to fix ResolutionImpossible on tox invocation.

https://github.com/openstack-charmers/release-tools/issues/151
https://github.com/openstack-charmers/release-tools/pull/152

Change-Id: Ic42a655ccf68ff5b9af92ee4f31bfa7e98e661f2
2021-07-22 14:54:36 +02:00
Zuul 939141a84c Merge "Remove moved content from README" 2021-06-28 21:43:28 +00:00
Zuul a5b408ff52 Merge "Safely delete node from ring" 2021-06-28 11:11:15 +00:00
David Ames 102d463aa3 Safely delete node from ring
Provide the delete-node-from-ring action to safely remove a known node
from the corosync ring.

Update the less safe update-ring action to avoid LP Bug #1933223 and
provide warnings in actions.yaml on its use.

Change-Id: I56cf2360ac41b12fc0a508881897ba63a5e89dbd
Closes-Bug: #1933223
2021-06-25 07:38:18 -07:00
Zuul 8215c5c9e3 Merge "Retry on "Transport endpoint is not connected"" 2021-06-25 07:45:16 +00:00