Skip to content

Commit

Permalink
tested support for 2.7.1 plugins and updated documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Greg Cockburn committed Jan 9, 2012
1 parent eb20644 commit 6bc81b0
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 70 deletions.
10 changes: 10 additions & 0 deletions README
Expand Up @@ -65,3 +65,13 @@ rabbitmq_user_permissions { 'dan@myhost':
write_permission => '.*',
provider => 'rabbitmqctl',
}

rabbitmq_plugin

- query all currently enabled plugins
#>puppet resource rabbitmq_plugin

rabbitmq_plugin {'rabbitmq_stomp':
ensure => present,
provider => 'rabbitmqplugins',
}
@@ -1,10 +1,10 @@
Puppet::Type.type(:rabbitmq_plugin).provide(:rabbitmq-plugins) do
Puppet::Type.type(:rabbitmq_plugin).provide(:rabbitmqplugins) do

commands :rabbitmq-plugins => 'rabbitmq-plugins'
commands :rabbitmqplugins => 'rabbitmq-plugins'
defaultfor :feature => :posix

def self.instances
rabbitmq-plugins('list -e').split(/\n/).map do |line|
rabbitmqplugins('list', '-e').split(/\n/).map do |line|
if line.split(/\s+/)[1] =~ /^(\S+)$/
new(:name => $1)
else
Expand All @@ -14,15 +14,15 @@ def self.instances
end

def create
rabbitmq-plugins('enable', resource[:name])
rabbitmqplugins('enable', resource[:name])
end

def destroy
rabbitmq-plugins('disable', resource[:name])
rabbitmqplugins('disable', resource[:name])
end

def exists?
out = rabbitmq-plugins('list -e').split(/\n/).detect do |line|
out = rabbitmqplugins('list', '-e').split(/\n/).detect do |line|
line.split(/\s+/)[1].match(/^#{resource[:name]}$/)
end
end
Expand Down
41 changes: 0 additions & 41 deletions manifests/plugin.pp

This file was deleted.

15 changes: 1 addition & 14 deletions manifests/server.pp
Expand Up @@ -9,9 +9,7 @@
# [*package_name*] - name of rabbitmq package
# [*service_name*] - name of rabbitmq service
# [*service_ensure*] - desired ensure state for service
# [*install_stomp*] - whether to install stomp (required for mcollective)
# [*stomp_port*] - port stomp should be listening on
# [*stomp_package*] - package name to install stomp
# [*config*] - contents of config file
# [*env_config*] - contents of env-config file
# Requires:
Expand All @@ -29,15 +27,13 @@
$version = 'UNSET',
$service_name = 'rabbitmq-server',
$service_ensure = 'running',
$install_stomp = false,
$config_stomp = false,
$stomp_port = '6163',
$stomp_package = 'rabbitmq-plugin-stomp',
$config='UNSET',
$env_config='UNSET'
) {

validate_bool($delete_guest_user, $install_stomp, $config_stomp)
validate_bool($delete_guest_user, $config_stomp)
validate_re($port, '\d+')
validate_re($stomp_port, '\d+')

Expand Down Expand Up @@ -66,15 +62,6 @@
notify => Class['rabbitmq::service'],
}

if $install_stomp {
package { $stomp_package:
ensure => installed,
notify => Class['rabbitmq::service'],
before => File['rabbitmq.config'],
}
$config_stomp = true
}

file { '/etc/rabbitmq':
ensure => directory,
owner => '0',
Expand Down
12 changes: 7 additions & 5 deletions tests/plugin.pp
@@ -1,9 +1,11 @@
$rabbitmq_plugins = [ 'amqp_client-2.3.1.ez', 'rabbit_stomp-2.3.1.ez' ]
class { 'rabbitmq::server':
install_stomp => true,
config_stomp => true,
}

rabbitmq::plugin { $rabbitmq_plugins:
ensure => present,
require => Class['rabbitmq']
$rabbitmq_plugins = [ 'amqp_client', 'rabbitmq_stomp' ]

rabbitmq_plugin { $rabbitmq_plugins:
ensure => present,
require => Class['rabbitmq::server'],
provider => 'rabbitmqplugins',
}
9 changes: 5 additions & 4 deletions tests/site.pp
@@ -1,15 +1,16 @@
node default {

$rabbitmq_plugins = [ 'amqp_client-2.3.1.ez', 'rabbit_stomp-2.3.1.ez' ]
$rabbitmq_plugins = [ 'amqp_client', 'rabbitmq_stomp' ]

class { 'rabbitmq::server':
config => '[ {rabbit_stomp, [{tcp_listeners, [1234]} ]} ].',
}

# Required for MCollective
rabbitmq::plugin { $rabbitmq_plugins:
ensure => present,
rabbitmq_plugin { $rabbitmq_plugins:
ensure => present,
require => Class['rabbitmq::server'],
provider => 'rabbitmqplugins',
}

}

0 comments on commit 6bc81b0

Please sign in to comment.