puppet-collectd
puppet-collectd copied to clipboard
Feature request: push scripts with exec plugin
Do you think it would be usefull to have an option to push scripts from puppet server to clients the same way that python plugin does it?
I like to do it in my environment, since this gives me an option to have a central repository for all scripts, they get updated through puppet and it's easy to see what scripts are loaded on each server...
I used to have a custom exec manifest, but now I've changed yours, so it works similar to Python one:
- Added script_source variable
- Added module variable
- Added file function
if $script_source {
file { "${module}.script":
ensure => $ensure,
path => "${conf_dir}/${module}.sh",
owner => 'root',
group => $collectd::params::root_group,
mode => '0640',
source => $script_source,
require => File[$conf_dir],
notify => Service['collectd'],
}
}
I'm no puppet master, so this might not be the nicest solution, but it works for me:) If you have any recommendations on how to perfect it, I can try and fix it and do a PR...
Matej
If the python plugin supports that feature then I would have no problem accepting it for the exec plugin
This would be fine. The python plugin does this. If I understand this, we could add a source to cmd, rather than exec:
https://github.com/voxpupuli/puppet-collectd/blob/master/manifests/plugin/exec/cmd.pp
The python plugin has this functionality in module.