Commit Graph

19 Commits

Author SHA1 Message Date
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
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
Zuul 485b0d3dcd Merge "Modify the output to action "cluster-status" to make it user friendly (rabbitmq)" 2021-12-13 12:52:56 +00:00
Anna Savchenko 223ec26617 Modify the output to action "cluster-status"
to make it user friendly (rabbitmq)

"rabbitmqctl cluster_status" uses escape codes to color/highlight the
output, and it does not have a way to suppress this. This makes the
output to the command "juju run-action rabbitmq-server/leader
cluster-status" not user friendly and difficult to read.

Add the json formatting option to the rabbitmqctl command and use
the json.dumps method to get a user friendly output.

Add unit test.

Closes-Bug: #1943198
Change-Id: I24380e24ff1edbede9c2db1671a4fc05d5a7cc63
2021-12-10 21:22:30 +02:00
James Page 9ed0e2d85c Switch to new configuration file format
For newer RabbitMQ versions, switch to using the new ini style
configuration file format (rabbitmq.conf vs rabbitmq.config).

This allows the charm to configure a wider set of options and
is needed to support limitation of TLS versions use for on the
wire encryption.

Upgrades at RabbitMQ 3.7.0 should switch from old to new format
and file name.

Change-Id: I6deda5ecf5990d527e22373540074d2a4b7bad38
Func-Test-PR: https://github.com/openstack-charmers/zaza-openstack-tests/pull/668
2021-11-16 09:35:31 +00:00
Liam Young 81c33953f9 Implementation of deferred restarts
Add deferred event actions and config.

Change-Id: Ifbb15c0c04117a5a98672b2af4fd7203dae9a18e
2021-04-09 21:11:30 +00:00
Peter Sabaini b3710a0085 Display queue sizes along with queues
When checking queues, display not only queue names but also their
size (number of messages). Return sizes as integers.

Also update parsing to account for a rabbitmqctl output change in
focal.

Closes-Bug: #1838964

Change-Id: I2014f065393a1ad4b594363ade6c01ccec4fb71a
2020-11-06 18:22:56 +01:00
Nicolas Bock ac1bc43ba9 Add `force-boot` action
This change adds a `force-boot` action which sets the `force_boot`
flag and restarts the RabbitMQ broker. This action can be used if a
broker refuses to start because the master of a queue is not
available.

Also add appropriate unit tests.

Change-Id: I8b01d1d668e18116c7f8b1fc56f197620a10c91f
Partial-Bug: #1828988
Signed-off-by: Nicolas Bock <nicolas.bock@canonical.com>
2020-06-22 13:04:11 +03:00
David Ames 5318764cc6 Forget cluster node as an action
There are race conditions in which the forget_cluster_node can get
executed against a node that is in the process of joining the cluster.

This change moves forget_cluster_node to an action that can be
performed by the administrator. The asses_cluster_status has been
updated to check for departed nodes and set status pointing toward the
use of the new forget-cluster-node action.

Closes-Bug: #1818260
Change-Id: I64bcdb9811a3816b394395fac19f5af5cc9f9006
2020-06-09 08:48:13 -07:00
David Ames 27b43f4bd6 Noop Flake8 update
Fix modern flake8 complaints with no functional changes.

Change-Id: I3eff9f9d8ee3952864ee0e78387b514c80c92bc4
2020-06-02 10:32:26 -07:00
Aurelien Lourot 7c18da3729 Pre-freeze 'make sync' and make list-unconsumed-queues more robust
Partial-Bug: #1878452
Func-Test-PR: https://github.com/openstack-charmers/zaza-openstack-tests/pull/288
Change-Id: I6e03ec2b918ca1fbb1563a981827c687814902c4
2020-05-19 21:37:18 +00:00
Drew Freiberger 6672c48136 Added list-unconsumed-queues action
Add status inquiry list-unconsumed-queues action to allow operators to
determine which queues are not being consumed in each RMQ vhost. Useful for
troubleshooting message queue volume alerts.

Closes-Bug: 1767437
Change-Id: Icdd0b8c4db607701bc5e33d86e263b6a5f1bb7f5
2019-02-27 09:36:13 +01:00
Alex Kavanagh 79a1ea26d6 Change charm to py3
The tests are still py2; they'll need an update to zaza at some point.

Change-Id: I2c4b1ba0212f96cf4a725c80d87b8b2bfed2186f
2018-10-24 14:50:35 +01:00
David Ames 50b301dab4 Series Upgrade
Implement the series-upgrade feature allowing to move between Ubuntu
series.

Change-Id: Iad105bb3287041d360852498f8a44c87e06bee16
2018-09-17 14:49:41 +02:00
Jill Rouleau 58b8ca09fc Add action to check rmq queues
Report back to the user any queues with greater than N messages.

Change-Id: Ia39c05a4fe0ce74682af24ffe3d17d3006001b62
Closes-Bug: 1716981
2018-02-26 09:46:00 -07:00
Felipe Reyes 058bac0515 Set universal_newlines=True when calling rabbitmqctl cluster_status
In python3 check_output() returns bytes, while python2 returns str,
passing universal_newlines=True assures it will return str no matter
what python version is used.

Change-Id: I34a490bc4142e78d725ad0973607587984ec7c49
Related-Bug: 1716981
2017-10-16 17:23:24 -03:00
Jill Rouleau 69cc374d11 Add cluster_status action, correct actions.py typo
Closes-Bug: #1716981
Change-Id: I100b4615dfb256f981da636d8e6cab211df59255
2017-10-11 21:39:04 +00:00
James Page ef1997c092 Re-license charm as Apache-2.0
All contributions to this charm where made under Canonical
copyright; switch to Apache-2.0 license as agreed so we
can move forward with official project status.

Change-Id: Ie4fc5353520eb3c3c0d14b1aa35703aeaea6ac40
2016-07-01 18:06:36 +01:00
Liam Young c2a69a73d6 Add pause/resume actions and sync charm-helpers
Adds pause and resume unit to the charm such that the
charm stays paused during maintenance operations.

Change-Id: I418a7e115b01ec1f108402de9e070c8bfa8f6003
Partial-Bug: 1558642
2016-04-05 18:52:37 +00:00