Skip to content

Commit

Permalink
remove rabbitmqadmin script and trigger refresh upon package upgrade …
Browse files Browse the repository at this point in the history
…or downgrade
  • Loading branch information
Sven Johanßon committed Jan 3, 2022
1 parent 728f886 commit 2cff357
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
3 changes: 3 additions & 0 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -540,6 +540,9 @@
if $admin_enable and $service_manage {
include 'rabbitmq::install::rabbitmqadmin'

# Trigger upgrade of rabbitmqadmin on package upgrade (Issue #804)
Class['rabbitmq::install'] ~> Class['rabbitmq::install::rabbitmqadmin']

Class['rabbitmq::service'] -> Class['rabbitmq::install::rabbitmqadmin']
Class['rabbitmq::install::rabbitmqadmin'] -> Rabbitmq_exchange<| |>
}
Expand Down
19 changes: 17 additions & 2 deletions manifests/install/rabbitmqadmin.pp
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,24 @@
}

if !($rabbitmq::use_config_file_for_plugins) {
$rabbitmqadmin_archive_require = [Class['rabbitmq::service'], Rabbitmq_plugin['rabbitmq_management']]
$rabbitmqadmin_archive_require = [
Class['rabbitmq::service'],
Rabbitmq_plugin['rabbitmq_management'],
Exec['remove_old_rabbitmqadmin_on_upgrade']
]
} else {
$rabbitmqadmin_archive_require = [Class['rabbitmq::service'], File['enabled_plugins']]
$rabbitmqadmin_archive_require = [
Class['rabbitmq::service'],
File['enabled_plugins'],
Exec['remove_old_rabbitmqadmin_on_upgrade']
]
}

Exec { 'remove_old_rabbitmqadmin_on_upgrade':
path => ['/bin','/usr/bin','/sbin','/usr/sbin'],
command => "rm ${rabbitmq::rabbitmq_home}/rabbitmqadmin",
onlyif => ["test -f ${rabbitmq::rabbitmq_home}/rabbitmqadmin"],
refreshonly => true,
}

archive { 'rabbitmqadmin':
Expand Down

0 comments on commit 2cff357

Please sign in to comment.