diff options
-rw-r--r-- | manifests/register.pp | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/manifests/register.pp b/manifests/register.pp index e1271e1..59500a0 100644 --- a/manifests/register.pp +++ b/manifests/register.pp @@ -1,10 +1,23 @@ -define munin::register() +define munin::register( + $host = 'absent', + $port = 'absent' +) { - $munin_port_real = $munin_port ? { '' => 4949, default => $munin_port } - $munin_host_real = $munin_host ? { - '' => $fqdn, - 'fqdn' => $fqdn, - default => $munin_host + $munin_port_real = $port ? { + 'absent' => $munin_port ? { + '' => 4949, + default => $munin_port + }, + default => $port + } + + $munin_host_real = $host ? { + 'absent' => $munin_host ? { + '' => $fqdn, + 'fqdn' => $fqdn, + default => $munin_host + }, + default => $host } @@file { "/var/lib/puppet/modules/munin/nodes/${name}_${munin_port_real}": |