From 000165503f79e6214047ba2622bdabf4176a68a0 Mon Sep 17 00:00:00 2001 From: Gabriel Filion Date: Tue, 23 Aug 2011 16:53:14 -0400 Subject: Move $puppet_default_config_dir to the puppet class We'd like to use this variable in the 'puppet' class since we're defining the path to another config file, there. Since puppet::puppetmaster inherits the puppet class, the variable will be defined appropriately. Just to make sure we get the value from the right place, let's also use the qualified variable name. To avoid useless repetitions in the variable name, change the variable name from $puppet_default_config_dir to $default_config_dir. Signed-off-by: Gabriel Filion --- manifests/init.pp | 10 ++++++---- manifests/puppetmaster/base.pp | 11 ++--------- 2 files changed, 8 insertions(+), 13 deletions(-) (limited to 'manifests') diff --git a/manifests/init.pp b/manifests/init.pp index fb10773..c05631a 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -19,15 +19,17 @@ # class puppet { - $puppet_default_config = $kernel ? { - freebsd => '/usr/local/etc/puppet/puppet.conf', - default => '/etc/puppet/puppet.conf', + $default_config_dir = $operatingsystem ? { + freebsd => "/usr/local/etc/puppet", + default => "/etc/puppet", } + $puppet_default_config = "$default_config_dir/puppet.conf" + if $puppet_config == '' { $puppet_config = $puppet_default_config } case $kernel { - linux: { + linux: { case $operatingsystem { gentoo: { include puppet::gentoo } centos: { include puppet::centos } diff --git a/manifests/puppetmaster/base.pp b/manifests/puppetmaster/base.pp index 820e499..0000513 100644 --- a/manifests/puppetmaster/base.pp +++ b/manifests/puppetmaster/base.pp @@ -5,21 +5,14 @@ class puppet::puppetmaster::base inherits puppet::base { "puppet:///modules/puppet/master/puppet.conf" ], } - # This is not in puppet::puppetmaster since we'd like for - # puppet::puppetmaster::cluster to work in FreeBSD too. - $puppet_default_config_dir = $operatingsystem ? { - freebsd => "/usr/local/etc/puppet", - default => "/etc/puppet", - } - - if !$puppet_fileserverconfig { $puppet_fileserverconfig = "${puppet_default_config_dir}/fileserver.conf" } + if !$puppet_fileserverconfig { $puppet_fileserverconfig = "${puppet::default_config_dir}/fileserver.conf" } file { "$puppet_fileserverconfig": source => [ "puppet:///modules/site-puppet/master/${fqdn}/fileserver.conf", "puppet:///modules/site-puppet/master/fileserver.conf", "puppet:///modules/puppet/master/fileserver.conf" ], owner => root, group => puppet, mode => 640; - } + } if $puppetmaster_storeconfigs { include puppet::puppetmaster::storeconfigs -- cgit v1.2.3