Skip to content
This repository has been archived by the owner on Dec 20, 2024. It is now read-only.

Simplification of plugin installation by source #261

Open
Herr-Herner opened this issue Nov 16, 2015 · 2 comments
Open

Simplification of plugin installation by source #261

Herr-Herner opened this issue Nov 16, 2015 · 2 comments

Comments

@Herr-Herner
Copy link

Because the current mcollective-puppet-agentpackages are unavailable in the current repos, I have created a source based defined resource. It uses some find operations on a directory structure to filter out the proper files for the server and the client side in respect to the matrix provided here: http://docs.puppetlabs.com/mcollective/deploy/plugins.html#about-plugins--available-plugin-types

I have put those resources to my profile, but I dislike the solution. The current state of the resource implementation is the following:

Server-Side:

define profile::mcollective::server::plugin($source, $ensure = 'present') {
  # Target
  $module_path = get_module_path('mcollective')
  $target      = "${module_path}/files/plugins/${name}"
  # Command
  $find    = '/usr/bin/find * -type f \\( -regex "^.*\\.\\(rb\\|ddl\\|erb\\)$" -and \\
  -regex "^\\(agent\\|audit\\|connector\\|data\\|facts\\|registration\\|security\\|util\\|validator\\).*" \\)'
  $command = "mkdir -p ${target} ; ${find} -exec cp --parents {} ${target} \\;"

  exec { "profile::mcollective::server::plugin::${name}":
    command => $command,
    cwd     => $source,
    creates => $target,
    path    => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin'
  }

Client-side:

define profile::mcollective::client::plugin ($source, $ensure = 'present') {
  # Target
  $module_path = get_module_path('mcollective')
  $target      = "${module_path}/files/plugins/${name}"
  # Command
  $find    = 'find * -type f \\( -regex "^.*\\.\\(rb\\|ddl\\|erb\\)$" -and \\
  -regex "^\\(agent\\|aggregate\\|application\\|connector\\|data\\|discovery\\|pluginpackager\\|security\\|util\\|validator\\).*" -and \\
    \\( -not -regex "^agent.*" -or -regex "^.*\\.ddl$" \\) -and \\( -not -regex "^data.*" -or -regex "^.*\\.ddl$" \\) \\)'
  $command = "mkdir -p ${target} ; ${find} -exec cp --parents {} ${target} \\;"

  exec { "profile::mcollective::client::plugin::${name}":
    command => $command,
    cwd     => $source,
    creates => $target,
    path    => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin'
  }

}

Should I try to inline this feature into the mcollective module? Is someone interested in this feature?

@igalic
Copy link
Contributor

igalic commented Nov 17, 2015

@Herr-Herner i'm very confused as to what this is trying to achieve, and how…

@jyaworski
Copy link
Member

What's the status of this?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants