summaryrefslogtreecommitdiffstats
path: root/lib/puppet
diff options
context:
space:
mode:
authorLuke Kanies <luke@madstop.com>2008-11-03 21:39:58 -0600
committerLuke Kanies <luke@madstop.com>2008-11-03 21:39:58 -0600
commitcf3a11cb641c6317f61d0f596bc8a137aa4adbca (patch)
treef4d351ba745bee59d9e8107b4f74e5d8734e6408 /lib/puppet
parenta78c971829959d9d4b89aa841249fc973b8972b2 (diff)
downloadpuppet-cf3a11cb641c6317f61d0f596bc8a137aa4adbca.tar.gz
puppet-cf3a11cb641c6317f61d0f596bc8a137aa4adbca.tar.xz
puppet-cf3a11cb641c6317f61d0f596bc8a137aa4adbca.zip
Fixing :bindaddress setting to work with the new server subsystem.
It now automatically switches values depending on server type, while still allowing overriding. Signed-off-by: Luke Kanies <luke@madstop.com>
Diffstat (limited to 'lib/puppet')
-rw-r--r--lib/puppet/defaults.rb9
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/puppet/defaults.rb b/lib/puppet/defaults.rb
index ba47dcd25..d0c2eff84 100644
--- a/lib/puppet/defaults.rb
+++ b/lib/puppet/defaults.rb
@@ -313,12 +313,15 @@ module Puppet
:config => ["$confdir/puppet.conf",
"The configuration file for #{Puppet[:name]}."],
:pidfile => ["$rundir/$name.pid", "The pid file"],
- :bindaddress => ["", "The address to bind to. Mongrel servers
+ :bindaddress => ["", "The address a listening server should bind to. Mongrel servers
default to 127.0.0.1 and WEBrick defaults to 0.0.0.0."],
- :servertype => ["webrick", "The type of server to use. Currently supported
+ :servertype => {:default => "webrick", :desc => "The type of server to use. Currently supported
options are webrick and mongrel. If you use mongrel, you will need
a proxy in front of the process or processes, since Mongrel cannot
- speak SSL."]
+ speak SSL.",
+ :call_on_define => true, # Call our hook with the default value, so we always get the correct bind address set.
+ :hook => proc { |value| value == "webrick" ? parent[:bindaddress] = "0.0.0.0" : parent[:bindaddress] = "127.0.0.1" if parent[:bindaddress] == "" }
+ }
)
self.setdefaults(:puppetmasterd,