forked from voxpupuli/puppet-rabbitmq
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
These plugins are modeled using a defined resource type named rabbitmq::plugin. They notify the service and require the package. However, this is not ideal since the defined type is establishing relationships to the resources inside the rabbitmq class. I plan to refactor rabbitmq into rabbitmq::service to address this issue. Then, I'll be able to use class level relationships.
- Loading branch information
Jeff McCune
committed
Mar 22, 2011
1 parent
f6b8fdd
commit 689cdce
Showing
6 changed files
with
66 additions
and
3 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
# Define: rabbitmq::plugin | ||
# | ||
# This defined resource type manages plugins for RabbitMQ | ||
# | ||
# Parameters: | ||
# | ||
# Actions: | ||
# | ||
# Requires: | ||
# | ||
# Sample Usage: | ||
# | ||
define rabbitmq::plugin( | ||
$ensure='UNSET', | ||
$source='UNSET' | ||
) { | ||
|
||
$plugin_dir = $::rabbitmq::params::plugin_dir | ||
$service = $::rabbitmq::params::service | ||
$packages = $::rabbitmq::params::packages | ||
|
||
if $source == 'UNSET' { | ||
$source_real = "puppet:///modules/rabbitmq/plugins/${name}" | ||
} else { | ||
$source_real = $source | ||
} | ||
|
||
if $ensure == 'UNSET' { | ||
$ensure_real = 'present' | ||
} else { | ||
if $ensure in [ 'present', 'absent' ] { | ||
$ensure_real = $ensure | ||
} else { | ||
fail("ensure must be present or absent. Received: ${ensure}") | ||
} | ||
} | ||
|
||
file { "${plugin_dir}/${name}": | ||
ensure => $ensure_real, | ||
source => $source_real, | ||
owner => '0', | ||
group => '0', | ||
mode => '0644', | ||
require => Package[$packages], | ||
notify => Service[$service], | ||
} | ||
|
||
} |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,15 @@ | ||
node default { | ||
|
||
$rabbitmq_plugins = [ 'amqp_client-2.3.1.ez', 'rabbit_stomp-2.3.1.ez' ] | ||
|
||
class { 'rabbitmq': | ||
config => template('rabbitmq/rabbitmq.conf'), | ||
} | ||
|
||
# Required for MCollective | ||
rabbitmq::plugin { $rabbitmq_plugins: | ||
ensure => present, | ||
} | ||
|
||
} | ||
|