From d09774c635ea72932727d6724ee847942ddafb77 Mon Sep 17 00:00:00 2001 From: antonio Date: Wed, 9 Apr 2014 15:45:37 +0200 Subject: Configurable host_name variable --- manifests/client.pp | 1 + templates/munin-node.conf.erb | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/manifests/client.pp b/manifests/client.pp index 6614709..7a96233 100644 --- a/manifests/client.pp +++ b/manifests/client.pp @@ -6,6 +6,7 @@ class munin::client( $allow = [ '127.0.0.1' ], $host = '*', + $host_name = '::fqdn', $port = '4949', $use_ssh = false, $manage_shorewall = false, diff --git a/templates/munin-node.conf.erb b/templates/munin-node.conf.erb index 4448002..891203c 100644 --- a/templates/munin-node.conf.erb +++ b/templates/munin-node.conf.erb @@ -34,7 +34,11 @@ ignore_file \.pod$ # Set this if the client doesn't report the correct hostname when # telnetting to localhost, port 4949 # +<% if scope.lookupvar('munin::client::host_name') == '::fqdn' -%> host_name <%= scope.lookupvar('::fqdn') %> +<% else -%> +host_name <%= scope.lookupvar('munin::client::host_name') %> +<% end -%> # A list of addresses that are allowed to connect. This must be a # regular expression, since Net::Server does not understand CIDR-style -- cgit v1.2.3 From 29919e02a8b3f27d9d516be586e92704b806a48e Mon Sep 17 00:00:00 2001 From: antonio Date: Thu, 12 Jun 2014 00:41:18 +0200 Subject: changed host_name default to ::fqdn --- manifests/client.pp | 2 +- templates/munin-node.conf.erb | 4 ---- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/manifests/client.pp b/manifests/client.pp index 7a96233..724ff05 100644 --- a/manifests/client.pp +++ b/manifests/client.pp @@ -6,7 +6,7 @@ class munin::client( $allow = [ '127.0.0.1' ], $host = '*', - $host_name = '::fqdn', + $host_name = $::fqdn, $port = '4949', $use_ssh = false, $manage_shorewall = false, diff --git a/templates/munin-node.conf.erb b/templates/munin-node.conf.erb index 891203c..b0c8fc8 100644 --- a/templates/munin-node.conf.erb +++ b/templates/munin-node.conf.erb @@ -34,11 +34,7 @@ ignore_file \.pod$ # Set this if the client doesn't report the correct hostname when # telnetting to localhost, port 4949 # -<% if scope.lookupvar('munin::client::host_name') == '::fqdn' -%> -host_name <%= scope.lookupvar('::fqdn') %> -<% else -%> host_name <%= scope.lookupvar('munin::client::host_name') %> -<% end -%> # A list of addresses that are allowed to connect. This must be a # regular expression, since Net::Server does not understand CIDR-style -- cgit v1.2.3