1 Puppet::Type.type(:rabbitmq_plugin).provide(:rabbitmqplugins) do
3 commands :rabbitmqplugins => '/usr/lib/rabbitmq/bin/rabbitmq-plugins'
4 defaultfor :feature => :posix
7 rabbitmqplugins('list', '-E').split(/\n/).map do |line|
8 if line.split(/\s+/)[1] =~ /^(\S+)$/
11 raise Puppet::Error, "Cannot parse invalid plugins line: #{line}"
17 rabbitmqplugins('enable', resource[:name])
21 rabbitmqplugins('disable', resource[:name])
25 out = rabbitmqplugins('list', '-E').split(/\n/).detect do |line|
26 line.split(/\s+/)[1].match(/^#{resource[:name]}$/)