From c871e91a13eb56ed441bf4323130d40d25a17f2a Mon Sep 17 00:00:00 2001 From: Ossi Salmi Date: Mon, 8 Nov 2010 13:28:35 +0200 Subject: [PATCH] Added homename fact --- custom/lib/facter/homename.rb | 8 ++++++++ puppet/templates/puppet.conf.erb | 4 ++++ 2 files changed, 12 insertions(+) create mode 100644 custom/lib/facter/homename.rb diff --git a/custom/lib/facter/homename.rb b/custom/lib/facter/homename.rb new file mode 100644 index 0000000..eb773e2 --- /dev/null +++ b/custom/lib/facter/homename.rb @@ -0,0 +1,8 @@ +require 'puppet' + +Facter.add('homename') do + setcode do + Puppet.parse_config + Puppet.settings.value('certname') + end +end diff --git a/puppet/templates/puppet.conf.erb b/puppet/templates/puppet.conf.erb index 540fb8f..af64384 100644 --- a/puppet/templates/puppet.conf.erb +++ b/puppet/templates/puppet.conf.erb @@ -28,6 +28,10 @@ # re-installs on remote networks. server = <%= puppet_server %> + # The name to use when handling certificates. Set during + # bootstrap based on the fully qualified domain name. + certname = <%= homename %> + # Enable sending reports to puppet server. report = true