summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGabriel Filion <lelutin@gmail.com>2011-08-23 16:53:14 -0400
committerGabriel Filion <lelutin@gmail.com>2011-08-23 16:53:14 -0400
commit000165503f79e6214047ba2622bdabf4176a68a0 (patch)
tree01db62dc19ff98089b0e555627df2b4c17fdabcd
parent56528806115735c1717408989d6d39049574333b (diff)
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 <lelutin@gmail.com>
-rw-r--r--manifests/init.pp10
-rw-r--r--manifests/puppetmaster/base.pp11
2 files changed, 8 insertions, 13 deletions
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