summaryrefslogtreecommitdiff
path: root/manifests/remoteplugin.pp
blob: dc03c76dd027bbe42878d9c5bea434a64794b17d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# Configure a munin remote plugin
define munin::remoteplugin(
  $source,
  $ensure = 'present',
  $config = ''
) {
  case $ensure {
    'absent': { munin::plugin{ $name: ensure => absent } }
    default: {
      file {
        "/var/lib/puppet/modules/munin/plugins/${name}":
          source => $source,
          mode   => '0755',
          owner  => root,
          group  => 0,
      }
      munin::plugin { $name:
        ensure         => $ensure,
        config         => $config,
        script_path_in => '/var/lib/puppet/modules/munin/plugins',
      }
    }
  }
}