puppet: Run configure-rabbitmq on nodename change.

`/etc/rabbitmq/rabbitmq-env.conf` sets the nodename; anytime the
nodename changes, the backing database changes, and this requires
re-creating the rabbitmq users and permissions.

Trigger this in puppet by running configure-rabbitmq after the file
changes.
This commit is contained in:
Alex Vandiver 2021-12-16 22:03:51 +00:00
parent b6cd89440e
commit 3bfcfeac24
2 changed files with 6 additions and 2 deletions

View File

@ -38,6 +38,7 @@ class zulip::profile::rabbitmq {
ensure => file, ensure => file,
require => File['/etc/rabbitmq'], require => File['/etc/rabbitmq'],
before => [Package[rabbitmq-server], Service[rabbitmq-server]], before => [Package[rabbitmq-server], Service[rabbitmq-server]],
notify => Exec['configure-rabbitmq'],
owner => 'root', owner => 'root',
group => 'root', group => 'root',
mode => '0644', mode => '0644',
@ -62,5 +63,9 @@ class zulip::profile::rabbitmq {
File['/etc/default/rabbitmq-server']], File['/etc/default/rabbitmq-server']],
} }
# TODO: Should also call exactly once "configure-rabbitmq" exec { 'configure-rabbitmq':
command => "${::zulip_scripts_path}/setup/configure-rabbitmq",
refreshonly => true,
require => Service['rabbitmq-server'],
}
} }

View File

@ -520,7 +520,6 @@ For more information, see:
EOF EOF
exit 1 exit 1
fi fi
"$ZULIP_PATH"/scripts/setup/configure-rabbitmq
fi fi
if has_class "zulip::postgresql_common" && [ -z "$NO_INIT_DB" ]; then if has_class "zulip::postgresql_common" && [ -z "$NO_INIT_DB" ]; then