Commit Graph

1130 Commits

Author SHA1 Message Date
Jadon Naas f9e1f451bf 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: I2fb654eb176318e9e72e84bf41650e878b989528
2023-08-08 20:54:14 -04:00
Zuul f2db41875d Merge "Add mantic support" 2023-08-04 21:58:42 +00:00
Corey Bryant d7a1c2159a Add mantic support
Change-Id: I37d874aaae1adc1611a79e48967cde23d23823f7
2023-07-20 11:33:19 -04:00
Jadon Naas 84b8605ed6 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: Idd4eb37dd413b49a99b8b81fd15d0b45f75ae97e
2023-07-18 13:52:01 -04:00
Zuul 3c155e2bda Merge "Drop 'source' config key override." 2023-05-21 19:53:17 +00:00
Felipe Reyes 8beeab1397 Drop 'source' config key override.
Drop configuration key 'source' override in rabbitmq-server and
mysql-innodb-cluster applications.

Add bindep.txt to install package dependencies needed to run unit tests.

Related-Bug: #1991528
Change-Id: I345e3bb7be7492286daf9e5ab36506915f3daab9
2023-05-16 19:37:13 +00:00
David Koslow 58c2a1aa93 Typo Fix: chaged => changed
Changed missing an "n".

Change-Id: I1cb50ded8bbe27894f197fae3a7fe7c29c337f63
2023-05-12 19:10:54 +00:00
Zuul 9278718a2b Merge "Add service user password rotation feature" 2023-05-09 14:00:49 +00:00
Zuul 167877f43d Merge "Allow NRPE to collect stats in CIS hardened env" 2023-05-05 11:48:03 +00:00
Alex Kavanagh 42714adfde Add service user password rotation feature
This patch adds the service user rotation feature, which provides two
actions:

 - list-service-usernames
 - rotate-service-user-password

The first lists the possible usernames that can be rotated.  The
second action rotates the service, and is tested via the func-test-pr.

Change-Id: Ia94ab3d54cd8a59e9ba5005b88d3ec1ff87019b1
func-test-pr: https://github.com/openstack-charmers/zaza-openstack-tests/pull/1029
2023-05-05 10:17:01 +02:00
Corey Bryant 09c507dd21 Add lunar, drop kinetic, and sync charm-helpers
Add 23.04 run-on base and add lunar to metadata.yaml.
Drop 22.10 run-on base and drop kinetic from metadata.yaml.
Charm-helper sync to pick up Antelope support.

Change-Id: I8a4f42249a8607c5d0baf3b9f19d8edd663ec1ca
2023-04-14 11:11:06 -04:00
Olivier Dufour-Cuvillier c9efea67c8 Allow NRPE to collect stats in CIS hardened env
It removes the necessity to run the cron task as root user
and ensure the content created in /var/lib/rabbitmq belongs
to rabbitmq user and group solely.

Then giving access for nrpe user is done by adding its user
to rabbitmq group.
Also implemented in the upgrade-charm hook for ongoing
deployments

Closes-Bug: #1879524
Change-Id: I19e3d675ace7c669451ca40a20d21cef1aec6a95
2023-04-13 00:36:40 +00:00
Zuul 415fcc4054 Merge "Enforce a maximum of 1024 async threads." 2023-04-12 17:36:45 +00:00
Vern Hart 3c1c05ee59 Enforce a maximum of 1024 async threads.
The beam.smp process won't start if more than 1024 are configured, the
charm could make this by default on large systems (e.g. more than 42
CPUs). This change makes RabbitMQEnvContext.calculate_threads() never
return more than 1024 (MAX_NUM_THREADS).

Change-Id: I92879445210bac6ee7d96a704cdf428ca738e3b6
Closes-Bug: #1768986
2023-04-11 16:55:44 -04:00
Edward Hope-Morley 8c9f68e8aa Fix typo in configure ttl code
Also fixes tox.ini

Change-Id: Ic4c2d34ff248d5429eb604824e42dbaba6ca2678
Closes-Bug: #1939681
2023-04-11 12:14:53 +01:00
Zuul 58b1693f63 Merge "Fix focal to jammy series upgrade" 2023-03-08 15:18:36 +00:00
Alex Kavanagh 55b985f55c Fix focal to jammy series upgrade
This is a fix/workaround to the package upgrade bug that affects the
charm.  The post-inst package script updates the .erlang.cookie if it is
insecure during the upgrade of rabbit from 3.8 to 3.9.  This breaks the
series-upgrade resulting in a charm erroring on the post-series-upgrade
hook.

This fix works by checking if the .erlang.cookie has changed during the
post-series-upgrade hook and either updating the cookie in peer storage
(if it is insecure) or ensuring that the cookie from peer storage is
written to the .erlang.cookie if it isn't the leader. This ensures that
the cluster continues to work and that the series-upgrade can be
completed across the cluster.

Change-Id: I540ea8da85b3b4326ccb8194f1d8b1050b04eae9
Closes-Bug: #2006485
2023-02-22 14:56:27 +00:00
Zuul 987c4d43f9 Merge "Fix upgrade-charm hook that was only partly run" 2023-02-10 15:52:35 +00:00
Corey Bryant f5aa13ee02 Add kinetic support and sync charm-helpers
Add 22.10 run-on base and add kinetic to metadata.yaml.
Sync charm-helpers to pick up kinetic support.

Change-Id: I26aaceb01f16ddb31123a37454a9cf0d61ed384c
2023-01-31 10:12:20 -05:00
Olivier Dufour-Cuvillier 2c1074e49f Fix upgrade-charm hook that was only partly run
upgrade-charm bash script was only executed and the hook
from rabbitmq_server_relations.py was silently ignored
This corrects at the same time a failure in the hook if
rabbitmq deployment was from a single unit without any
cluster.

Closes-Bug: #1993100
Change-Id: Iaf88d18d26a1cde23397a097fcd98b09a0a98846
2023-01-19 00:59:23 +00:00
Liam Young 0ef5451292 Fix charm for tox4 compatibility
Related-Bug: 2002788
Change-Id: I31af9a4c1ea8beba1e5ad4311a80002c1174beed
2023-01-16 15:38:41 +00:00
Alex Kavanagh 81f08ab769 Fix issue where charms aren't clustered but RMQ is
Due to the @cache decorator in the code, it was possible to get the
charm into a state where RMQ is clustered, but the charm doesn't record
it.  The charm 'thinks' it is clustered when it has set the 'clustered'
key on the 'cluster' relation.  Unfortunately, due to the @cached
decorator it's possible in the 'cluster-relation-changed' hook to have a
situation where the RMQ instance clusters during the hook execution and
then, later, when it's supposed to writing the 'clustered' key, it reads
the previous cached value where it wasn't clustered and therefore
doesn't set the 'clustered' key.  This is just about the only
opportunity to do it, and so the charm ends up being locked.

The fix was to clear the @cache values so that the nodes would be
re-read, and this allows the charm to then write the 'clustered' key.

Change-Id: I12be41a83323d150ba1cbaeef64041f0bb5e32ce
Closes-Bug: #1975605
2023-01-06 20:39:50 +00:00
Alex Kavanagh 09ade6b5ee Fix up the tox.ini to work with tox 4
* unpin the requires for pip, virtualenv and setuptools
* remove the pip.sh installer file.
* split the passenv to to have a var on each line (overcomes new ','
  requirement).
* switch charm-tools to 2.8.4 to remove ruamel requirement that doesn't
  work on Python 3.10

Change-Id: I44849aac8ead5e3e660ccd9d1305cc991461d02d
2023-01-04 11:34:35 +00:00
Zuul fdb3d0a614 Merge "Update bundles to use yoga" 2022-10-20 16:26:57 +00:00
Zuul 991d527a8f Merge "Fix jammy-yoga bundle." 2022-10-20 16:26:56 +00:00
Zuul 956417ba41 Merge "Revert "Add Kinetic and Zed support"" 2022-10-20 16:25:54 +00:00
Felipe Reyes f22bb10257 Update bundles to use yoga
This change reconfigures the bundles to use OpenStack yoga, they are the
last version that support Focal and Jammy.

Change-Id: Ia54bfacee6635c1e85a0c97e22bc2a5974bda7d1
Closes-Bug: #1991528
2022-10-17 22:16:29 -03:00
Felipe Reyes 24d557ffdc Fix jammy-yoga bundle.
This change fixes the jammy-yoga bundle placement directives.

Func-Test-Pr: https://github.com/openstack-charmers/zaza-openstack-tests/pull/793
Related-Bug: #1968008
Change-Id: Icc3c4918a877a7c43c049f412a85a23c5dbcbd95
2022-10-18 01:07:35 +00:00
Alex Kavanagh fe49d91046 Revert "Add Kinetic and Zed support"
This reverts commit c0beec6fa2.

Reason for revert: I think this should be reverted as it removes focal support from the rabbitmq-server master, and thus this won't cherry-pick cleanly to the stable/jammy channel for the 3.9 track.

Change-Id: Iebab77fcc0cee31af66980c2d3be334fffe06222
2022-08-31 11:42:29 +00:00
Zuul 7c65a33ea8 Merge "Add Kinetic and Zed support" 2022-08-30 03:37:09 +00:00
Corey Bryant c0beec6fa2 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: I93da9ce52bed2b3e8a467491d2a61bfd2ed4ea7d
2022-08-26 18:40:43 +00:00
Zuul eadb7948b7 Merge "CONFIG_FILES is not a constant" 2022-07-04 14:08:00 +00:00
Felipe Reyes b35247364f Set cluster-partition-handling on upgrade-charm.
For units deployed before the implementation of the
cluster-partition-handling strategy they won't have that key set in the
leader making the charm believe there are pending tasks, so this change
seeds the key when is not set with the value present in the charm's
configuration.

Change-Id: Ifdae35ffee1ad7a8f4e5248c817cca14b69d9566
Closes-Bug: #1979092
2022-06-17 16:36:51 -04:00
Billy Olsen f790b2f645 CONFIG_FILES is not a constant
The CONFIG_FILES is not a constant, its a method and when this
is passed to the ConfigRenderer it will cause a failure because
the items() function does not exist (since its not a dict).

Change-Id: Ice6cce6a736d96883eb8bc003852c2df60af7c62
Closes-Bug: 1971451
2022-06-16 15:26:07 -07:00
Zuul eac35c1d99 Merge "Remove legacy checks" 2022-04-25 12:29:33 +00:00
Zuul 99fd28ccc1 Merge "Handle non-uniform queue stats output" 2022-04-14 05:22:11 +00:00
Tianqi 9376aeb8e6 Handle non-uniform queue stats output
RabbitMQ sesrver sometimes creates non-uniform outputs that nrpe
can't parse. Instead of breaking the check, this commit outputs
the error messages and continue the check.

This problem is most likely caused by queue state being
"down" [1]. However, because the current charm doesn't show such
information and the bug is hard to manually reproduce, this
commit adds the state attribute when creating queue_state file
for future debugging.

[1] https://www.rabbitmq.com/rabbitmqctl.8.html#state_2

Closes-Bug: #1850948
Change-Id: Iaa493c8270f344cde8ad7c89bd2bb548f0ad71bd
2022-04-13 21:53:33 +00:00
Billy Olsen 26b9434648 Remove legacy checks
Remove legacy checks from set_ha_mode in rabbit_utils.py as it checks
for versions of rabbitmq which is less than version 3.0.0 which is not
available in the archives for any supported releases.

Change-Id: Ib21f6ae3f30eabaaa8d677c20a555ded4e6851d6
2022-04-13 12:51:23 -07:00
Billy Olsen 09ce13aaf2 Remove unused config options
The config options `module-nodes` and `known-wait` are no longer used
after commit 12de0d964c introduced
coordinated restarts across the rabbit cluster. This change removes
those charm config options.

Change-Id: I3aee35633e0716f8ce933ee3079494dbc761c04d
2022-04-12 14:53:36 -07:00
Billy Olsen 370a6315ae Drop nagios/nrpe from Jammy test bundles
The nrpe charm doesn't support jammy yet, which is a problem because it
is a subordinate charm. Drop it from the test bundles for the time being
and when this is resolved, it will be added back in.

Change-Id: Id54c0d145fb111914a38e9ed5776712ec6a92f87
2022-04-07 06:25:35 -07:00
James Page b2136a150e 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: Ib9e5c7718ffaf28070fd9439f46453d7cf2333b5
2022-04-05 14:13:01 +01:00
Liam Young 12de0d964c Coordinate cluster join events
Use the coordination module when cluster join events are called.
The `cluster_wait` method has been removed as it is no longer used
and `cluster_with` has been broken up into three new methods (
`clustered_with_leader`, `update_peer_cluster_status` and
`join_leader`) which can be called separately. The `modulo-nodes`
and `known-wait` charm options have been removed as they are no
longer needed.

Closes-Bug: #1902793
Change-Id: I136f5dcc855da329071e119b67df25d9045e86cc
2022-02-18 15:18:06 +00:00
Liam Young 70cbe1eef9 Coordinate package upgrades across cluster
Use the coordination module to manage package upgrades across the
cluster. To each this some of the setup was moved into a new
configure_rabbit_install method which handles setup is normally
run after an upgrade.

Change-Id: I8d244d96c83a5da164322faff873a72530ec9def
2022-02-17 11:06:04 +00:00
Liam Young 3d5e1e22d8 Coordination module for rabbit restarts
Use the coordination module to manage restarting the rabbitmq
services. This is to ensure that restarts are only
performed on one unit at a time. This helps prevent
situation which can cause the cluster to become split
brained (eg if two or more nodes are restarted at the same
time).

* Manually run _run_atstart & _run_atexit method when actions
  are run as this does not happen automatically and is needed by
  the coordination layer.
* Replace restart_on_change decorator with
  coordinated_restart_on_change. coordinated_restart_on_change
  includes logic for requesting restart locks from the coordination
  module.
* The coordination module works via the leader and cluster events so
  the hooks now include calls to check_coordinated_functions
  which will run any function that is waiting for a lock.
* Logic has been added to check for the situation where a hook is
  being run via the run_deferred_hooks actions. If this is the
  case then restarts are immediate as the action should only be run
  on one unit at a time.

Change-Id: Ia133c90a610793d4da96d3400a3906b801b52b73
2022-02-17 11:06:00 +00:00
Alex Kavanagh b0b51cc6ea 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: I3cb1f519e8f1d6765b41751994633be73e5bdea5
2022-02-15 17:06:59 +00:00
Billy Olsen c01df1bc35 Add charmhelpers to charmcraft.yaml
Charmhelpers directory was missed in the conversion to the charmcraft
way of building charms. The rabbit charm has a slightly different
location for charmhelpers than other charms. Add charmhelpers to
charmcraft.yaml to ensure it is packed in the charm file.

Change-Id: I72155c4bd2ace7497d59eeec3552985aec39d44b
Closes-Bug: #1960769
2022-02-13 20:40:13 -07:00
Zuul 3051d5f567 Merge "Charmhelper sync pulling coordinator" 2022-02-10 01:15:17 +00:00
Zuul f44cccc505 Merge "Check before applying plugin and perms changes" 2022-02-08 21:53:14 +00:00
Liam Young c63cd1b99f Charmhelper sync pulling coordinator
Change-Id: Ia92c8d8544534ffcab9a7fd31ba6f35a3bf076ca
2022-02-07 09:42:38 +00:00
Alex Kavanagh 009ef87594 Migrate charm to charmhub latest/edge track
Change-Id: I04094f4392ba1057202fa3f4d58720bc9c14048b
Co-authored-by: Aurelien Lourot <aurelien.lourot@canonical.com>
2022-01-29 10:25:46 -07:00