summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2006-05-18 22:16:03 +0000
committerluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2006-05-18 22:16:03 +0000
commit5671ce8bbc6eb75664190a7a2fe4b195ee31d4b7 (patch)
treead60e819920884794907d3cdca673895ebaf36d2 /bin
parentb3ea53cd99df84a93fe2f093d2224e711f49e5dd (diff)
Added the last of the tests for the runner, along with the necessary work in puppetd to be able to start it.
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1213 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'bin')
-rwxr-xr-xbin/puppetd51
1 files changed, 33 insertions, 18 deletions
diff --git a/bin/puppetd b/bin/puppetd
index 703bb8a21..4701a9f8b 100755
--- a/bin/puppetd
+++ b/bin/puppetd
@@ -9,8 +9,8 @@
# = Usage
#
# puppetd [-D|--daemonize] [-d|--debug] [--disable] [--enable]
-# [-h|--help] [--fqdn <host name>] [--listen]
-# [-l|--logdest syslog|<file>|console] [-o|--onetime] [-t|--test]
+# [-h|--help] [--fqdn <host name>] [-l|--logdest syslog|<file>|console]
+# [-o|--onetime] [--serve <handler>] [-t|--test]
# [-V|--version] [-v|--verbose] [-w|--waitforcert <seconds>]
#
# = Description
@@ -94,12 +94,6 @@
# help::
# Print this help message
#
-# listen::
-# Start a local listening server. This allows you to remotely manage
-# puppet nodes over XMLRPC. The client will fail to start if the
-# authorization config file (defaults to /etc/puppetd/namespaceauth.conf)
-# does not exist.
-#
# logdest::
# Where to send messages. Choose between syslog, the console, and a log file.
# Defaults to sending messages to syslog, or the console if debugging or
@@ -109,6 +103,13 @@
# Run the configuration once, rather than as a long-running daemon. This is
# useful for interactively running puppetd.
#
+# serve::
+# Start another type of server. By default default, +puppetd+ will start
+# a server that allows authenticated and authorized remote nodes to trigger
+# the configuration to be pulled down and applied. You can specify
+# any other type of service here that does not require configuration,
+# e.g., filebucket, ca, or pelement.
+#
# test::
# Enable the most common options used for testing. These are +onetime+,
# +verbose+, and +no-usecacheonfailure+.
@@ -169,7 +170,6 @@ options = [
[ "--onetime", "-o", GetoptLong::NO_ARGUMENT ],
[ "--test", "-t", GetoptLong::NO_ARGUMENT ],
[ "--no-client", GetoptLong::NO_ARGUMENT ],
- [ "--listen", GetoptLong::NO_ARGUMENT ],
[ "--verbose", "-v", GetoptLong::NO_ARGUMENT ],
[ "--version", "-V", GetoptLong::NO_ARGUMENT ],
[ "--waitforcert", "-w", GetoptLong::REQUIRED_ARGUMENT ]
@@ -189,9 +189,9 @@ options = {
:setdest => false,
:enable => false,
:disable => false,
- :listen => false,
:client => true,
- :fqdn => nil
+ :fqdn => nil,
+ :serve => {}
}
begin
@@ -203,6 +203,10 @@ begin
options[:daemonize] = true
when "--disable"
options[:disable] = true
+ when "--serve"
+ if klass = Puppet::Server::Handler.handler(arg)
+ options[:serve][klass.name] = klass
+ end
when "--enable"
options[:enable] = true
when "--test"
@@ -215,8 +219,6 @@ begin
Puppet::Log.newdestination(:console)
when "--centrallogging"
options[:centrallogs] = true
- when "--listen"
- options[:listen] = true
when "--help"
if $haveusage
RDoc::usage && exit
@@ -348,15 +350,28 @@ unless client.readcert
end
objects = []
+
# This has to go after the certs are dealt with.
-if options[:listen]
+if Puppet[:listen]
unless FileTest.exists?(Puppet[:authconfig])
- $stderr.puts "Will not start with authorization file %s" % Puppet[:authconfig]
+ $stderr.puts "Will not start without authorization file %s" %
+ Puppet[:authconfig]
exit(14)
end
- handlers = {
- :PElement => {}
- }
+
+ handlers = nil
+
+ if options[:serve].empty?
+ handlers = {:Runner => {}}
+ else
+ handlers = options[:serve].inject({}) do |hash, name, klass|
+ hash[name] = {}
+ end
+ end
+
+ handlers.each do |name, hash|
+ Puppet.info "Starting handler for %s" % name
+ end
args[:Handlers] = handlers
args[:Port] = Puppet[:puppetport]