Merge lp:~simpoir/landscape-charm/1501803_ha_amqp into lp:~landscape/landscape-charm/trunk

Proposed by Simon Poirier
Status: Merged
Approved by: Simon Poirier
Approved revision: 404
Merged at revision: 404
Proposed branch: lp:~simpoir/landscape-charm/1501803_ha_amqp
Merge into: lp:~landscape/landscape-charm/trunk
Diff against target: 52 lines (+28/-2)
2 files modified
lib/tests/test_templates.py (+26/-0)
templates/service.conf (+2/-2)
To merge this branch: bzr merge lp:~simpoir/landscape-charm/1501803_ha_amqp
Reviewer Review Type Date Requested Status
Maximiliano Bertacchini Approve
Review via email: mp+406052@code.launchpad.net

Commit message

Add all units to broker section with HA rabbitmq.

Description of the change

Add all units to broker section with HA rabbitmq.

Testing instructions:

juju bootstrap localhost
make bundles-local-charm
juju deploy ./bundles/build/landscape-scalable/bundle.yaml
juju add-unit rabbitmq-server
# wait for units to settle
juju run --unit landscape-server/0 -- cat /etc/landscape/service.conf|grep -n3 broker

To post a comment you must log in.
Revision history for this message
Maximiliano Bertacchini (maxiberta) wrote :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'lib/tests/test_templates.py'
--- lib/tests/test_templates.py 2021-04-13 19:03:22 +0000
+++ lib/tests/test_templates.py 2021-07-21 22:39:31 +0000
@@ -240,6 +240,32 @@
240 "/etc/landscape/gpg-passphrase.txt",240 "/etc/landscape/gpg-passphrase.txt",
241 config.get("api", "gpg-passphrase-path"))241 config.get("api", "gpg-passphrase-path"))
242242
243 def test_broker_ha(self):
244 """
245 Verify that broker gets a list of multiple rabbit servers if
246 multiple such units exist.
247 """
248 self.context["amqp"] = [
249 {
250 "hostname": "roger",
251 "password": "secret",
252 },
253 {
254 "hostname": "bugs",
255 "password": "secret",
256 },
257 {
258 "hostname": "lola",
259 "password": "secret",
260 },
261 ]
262
263 buffer = StringIO(self.template.render(self.context))
264 config = ConfigParser()
265 config.readfp(buffer)
266 self.assertEqual("roger,bugs,lola", config.get("broker", "host"))
267 self.assertEqual("secret", config.get("broker", "password"))
268
243269
244class LandscapeDefaultsTest(TemplateTest):270class LandscapeDefaultsTest(TemplateTest):
245271
246272
=== modified file 'templates/service.conf'
--- templates/service.conf 2021-04-16 19:21:23 +0000
+++ templates/service.conf 2021-07-21 22:39:31 +0000
@@ -24,9 +24,9 @@
2424
25[broker]25[broker]
26port = 567226port = 5672
27host = {{ rabbitmq["hostname"] }}27host = {{ amqp|join(",", attribute="hostname") }}
28user = landscape28user = landscape
29password = {{ rabbitmq["password"] }}29password = {{ amqp[0]["password"] }}
30vhost = landscape30vhost = landscape
3131
32[schema]32[schema]

Subscribers

People subscribed via source and target branches