Skip to content

Commit

Permalink
Allow puppet moduledir spec for mcollective plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
Adrien Thebo committed Jun 29, 2012
1 parent 5fbf11e commit 282afca
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
8 changes: 3 additions & 5 deletions manifests/plugin.pp
Original file line number Diff line number Diff line change
@@ -1,24 +1,22 @@
define mcollective::plugin($has_ddl = false) {
define mcollective::plugin($has_ddl = false, $module = 'mcollective') {

include mcollective::params
include mcollective::server
include mcollective::server::pluginbase

$filebase = "${mcollective::params::libdir}/mcollective/${name}"

# This assumes that we're only going to install vendored plugins. This is
# fucking silly and lazy.
file { "${filebase}.rb":
ensure => present,
mode => '0644',
owner => 'root',
group => 'root',
source => "puppet:///modules/mcollective/plugins/${name}.rb",
source => "puppet:///modules/${module}/plugins/${name}.rb",
before => Package['mcollective'],
notify => Service['mcollective'],
}

if $has_ddl {
mcollective::plugin::ddl { $name: }
mcollective::plugin::ddl { $name: module => $module }
}
}
4 changes: 2 additions & 2 deletions manifests/plugin/ddl.pp
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Allow plugins and DDLs to be shipped separately if desired
define mcollective::plugin::ddl {
define mcollective::plugin::ddl($module = 'mcollective') {
file { "${filebase}.ddl":
ensure => present,
mode => '0644',
owner => 'root',
group => 'root',
source => "puppet:///modules/mcollective/plugins/${name}.ddl",
source => "puppet:///modules/${module}/plugins/${name}.ddl",
before => [Package['mcollective'], Service['mcollective']],
}
}

0 comments on commit 282afca

Please sign in to comment.