From 3bfcfeac245c038fbadd80ae93dec7b43cec065b Mon Sep 17 00:00:00 2001 From: Alex Vandiver Date: Thu, 16 Dec 2021 22:03:51 +0000 Subject: [PATCH] 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. --- puppet/zulip/manifests/profile/rabbitmq.pp | 7 ++++++- scripts/lib/install | 1 - 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/puppet/zulip/manifests/profile/rabbitmq.pp b/puppet/zulip/manifests/profile/rabbitmq.pp index 8f740e3ed7..80131e6116 100644 --- a/puppet/zulip/manifests/profile/rabbitmq.pp +++ b/puppet/zulip/manifests/profile/rabbitmq.pp @@ -38,6 +38,7 @@ class zulip::profile::rabbitmq { ensure => file, require => File['/etc/rabbitmq'], before => [Package[rabbitmq-server], Service[rabbitmq-server]], + notify => Exec['configure-rabbitmq'], owner => 'root', group => 'root', mode => '0644', @@ -62,5 +63,9 @@ class zulip::profile::rabbitmq { 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'], + } } diff --git a/scripts/lib/install b/scripts/lib/install index e648b9ae91..06715b9cc8 100755 --- a/scripts/lib/install +++ b/scripts/lib/install @@ -520,7 +520,6 @@ For more information, see: EOF exit 1 fi - "$ZULIP_PATH"/scripts/setup/configure-rabbitmq fi if has_class "zulip::postgresql_common" && [ -z "$NO_INIT_DB" ]; then