summaryrefslogtreecommitdiff
path: root/bin/puppetd
diff options
context:
space:
mode:
Diffstat (limited to 'bin/puppetd')
-rwxr-xr-xbin/puppetd26
1 files changed, 16 insertions, 10 deletions
diff --git a/bin/puppetd b/bin/puppetd
index ecea2d894..2a71a9a08 100755
--- a/bin/puppetd
+++ b/bin/puppetd
@@ -162,7 +162,8 @@ trap(:INT) do
end
require 'puppet'
-require 'puppet/network/client'
+require 'puppet/agent'
+require 'puppet/configurer'
require 'getoptlong'
options = [
@@ -329,13 +330,19 @@ Puppet::SSL::Host.ca_location = :remote
Puppet::Transaction::Report.terminus_class = :rest
+Puppet::Resource::Catalog.terminus_class = :rest
+Puppet::Resource::Catalog.cache_class = :yaml
+
+Puppet::Node::Facts.terminus_class = :facter
+Puppet::Node::Facts.cache_class = :rest
+
# We need tomake the client either way, we just don't start it
# if --no-client is set.
-client = Puppet::Network::Client.master.new(args)
+agent = Puppet::Agent.new(Puppet::Configurer)
if options[:enable]
- client.enable
+ agent.enable
elsif options[:disable]
- client.disable
+ agent.disable
end
if options[:enable] or options[:disable]
@@ -347,12 +354,11 @@ server = nil
# It'd be nice to daemonize later, but we have to daemonize before the
# waitforcert happens.
if Puppet[:daemonize]
- client.daemonize
+ agent.daemonize
end
host = Puppet::SSL::Host.new
cert = host.wait_for_cert(options[:waitforcert])
-client.recycle_connection
objects = []
@@ -402,7 +408,7 @@ elsif options[:onetime] and Puppet[:listen]
end
if options[:client]
- objects << client
+ objects << agent
end
# Set traps for INT and TERM
@@ -417,10 +423,10 @@ if options[:onetime]
end
# Add the service, so the traps work correctly.
- Puppet.newservice(client)
+ Puppet.newservice(agent)
begin
- client.run
+ agent.run
rescue => detail
if Puppet[:trace]
puts detail.backtrace
@@ -435,7 +441,7 @@ else
if options[:client]
Puppet.notice "Starting Puppet client version %s" % [Puppet.version]
- Puppet.newservice(client)
+ Puppet.newservice(agent)
end
Puppet.settraps