summaryrefslogtreecommitdiffstats
path: root/bin/puppetmasterd
diff options
context:
space:
mode:
authorLuke Kanies <luke@madstop.com>2005-08-28 02:23:10 +0000
committerLuke Kanies <luke@madstop.com>2005-08-28 02:23:10 +0000
commitf2795359521709b5d4a64900ebed5e7b0be84c6b (patch)
tree59aba403256c85c6d0de6170422f2c2066329aa8 /bin/puppetmasterd
parent28be88cc6e13c1af193fe01d56a1a446a18e01bb (diff)
downloadpuppet-f2795359521709b5d4a64900ebed5e7b0be84c6b.tar.gz
puppet-f2795359521709b5d4a64900ebed5e7b0be84c6b.tar.xz
puppet-f2795359521709b5d4a64900ebed5e7b0be84c6b.zip
This should be the commit that brings us to Beta 1. All tests pass, although I get some (gracefully handled) failures in tc_metrics.rb, and there is now a config file for the fileserver module, including authorization specification for it. I have also reworked error handling in the xmlrpc client and server so errors should propagate more correctly.
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@594 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'bin/puppetmasterd')
-rwxr-xr-xbin/puppetmasterd46
1 files changed, 33 insertions, 13 deletions
diff --git a/bin/puppetmasterd b/bin/puppetmasterd
index 8ed9f739e..0c832aba6 100755
--- a/bin/puppetmasterd
+++ b/bin/puppetmasterd
@@ -15,6 +15,7 @@ result = GetoptLong.new(
[ "--ssldir", "-s", GetoptLong::REQUIRED_ARGUMENT ],
[ "--port", "-p", GetoptLong::REQUIRED_ARGUMENT ],
[ "--noinit", "-n", GetoptLong::NO_ARGUMENT ],
+ [ "--autosign", "-a", GetoptLong::NO_ARGUMENT ],
[ "--debug", "-d", GetoptLong::NO_ARGUMENT ],
[ "--verbose", "-v", GetoptLong::NO_ARGUMENT ],
[ "--noca", GetoptLong::NO_ARGUMENT ],
@@ -22,7 +23,11 @@ result = GetoptLong.new(
)
noinit = false
-ca = true
+
+haveca = true
+master = {}
+ca = {}
+args = {}
result.each { |opt,arg|
case opt
@@ -33,20 +38,23 @@ result.each { |opt,arg|
Puppet[:loglevel] = :info
when "--debug"
Puppet[:debug] = true
+ when "--autosign"
+ ca[:autosign] = true
when "--noca"
- ca = false
+ haveca = false
when "--port"
- Puppet[:masterport] = arg
+ args[:Port] = arg
when "--ssldir"
Puppet[:ssldir] = arg
when "--manifest"
- Puppet[:manifest] = arg
+ master[:File] = arg
when "--noinit"
noinit = true
when "--logfile"
- Puppet[:masterlog] = arg
+ args[:AccessLog] = arg
else
- raise "Invalid option '#{opt}'"
+ $stderr.puts "Invalid option '#{opt}'"
+ exit(1)
end
}
@@ -62,16 +70,28 @@ if bg
Puppet[:logdest] = Puppet[:masterlog]
end
+handlers = {
+ :Master => master,
+ :Status => {}
+}
+
+
+if haveca
+ handlers[:CA] = ca
+end
+
+if File.exists?(Puppet[:fileserverconfig])
+ handlers[:FileServer] = {
+ :Config => Puppet[:fileserverconfig]
+ }
+end
+
+args[:Handlers] = handlers
+
begin
# use the default, um, everything
#server = Puppet::Server.new(:CA => ca)
- server = Puppet::Server.new(
- :Handlers => {
- :CA => {}, # so that certs autogenerate
- :Master => {},
- :Status => {}
- }
- )
+ server = Puppet::Server.new(args)
rescue => detail
$stderr.puts detail
exit(1)