Skip to content

Commit

Permalink
Merge pull request voxpupuli#570 from wyardley/issues_566
Browse files Browse the repository at this point in the history
Switch back to using rabbitmq-plugins from system path (voxpupuli#566)
  • Loading branch information
bastelfreak authored Sep 13, 2017
2 parents fac7eb0 + f8e5597 commit 58d69be
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions lib/puppet/provider/rabbitmq_plugin/rabbitmqplugins.rb
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
require File.expand_path(File.join(File.dirname(__FILE__), '..', 'rabbitmqctl'))
Puppet::Type.type(:rabbitmq_plugin).provide(:rabbitmqplugins, parent: Puppet::Provider::Rabbitmqctl) do
case Facter.value(:osfamily)
when 'RedHat'
has_command(:rabbitmqplugins, '/usr/lib/rabbitmq/bin/rabbitmq-plugins') { environment HOME: '/tmp' }
# Prefer rabbitmq-plugins if it's in $PATH, but fall back to /usr/lib/rabbitmq/bin
if Puppet::Util.which('rabbitmq-plugins')
has_command(:rabbitmqplugins, 'rabbitmq-plugins') do
environment HOME: '/tmp'
end
else
has_command(:rabbitmqplugins, 'rabbitmq-plugins') { environment HOME: '/tmp' }
has_command(:rabbitmqplugins, '/usr/lib/rabbitmq/bin/rabbitmq-plugins') do
environment HOME: '/tmp'
end
end

defaultfor feature: :posix
Expand Down

0 comments on commit 58d69be

Please sign in to comment.