summaryrefslogtreecommitdiffstats
path: root/lib/puppet/client/master.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/puppet/client/master.rb')
-rw-r--r--lib/puppet/client/master.rb27
1 files changed, 27 insertions, 0 deletions
diff --git a/lib/puppet/client/master.rb b/lib/puppet/client/master.rb
index 3f54fa27f..6d57a310a 100644
--- a/lib/puppet/client/master.rb
+++ b/lib/puppet/client/master.rb
@@ -19,6 +19,15 @@ class Puppet::Client::MasterClient < Puppet::Client
]
)
+ Puppet.setdefaults(:puppetd,
+ :reportserver => ["puppet",
+ "The server to which to send transaction reports."
+ ],
+ :report => [false,
+ "Whether to send reports after every transaction."
+ ]
+ )
+
Puppet.setdefaults("puppet",
:pluginpath => ["$vardir/plugins",
"Where Puppet should look for plugins. Multiple directories should
@@ -102,6 +111,14 @@ class Puppet::Client::MasterClient < Puppet::Client
Metric.graph
end
+ if Puppet[:report]
+ begin
+ reportclient().report(transaction)
+ rescue => detail
+ Puppet.err "Reporting failed: %s" % detail
+ end
+ end
+
return transaction
end
@@ -480,6 +497,16 @@ class Puppet::Client::MasterClient < Puppet::Client
# Now clean up after ourselves
plugins.remove
end
+
+ def reportclient
+ unless defined? @reportclient
+ @reportclient = Puppet::Client::Reporter.new(
+ :Server => Puppet[:reportserver]
+ )
+ end
+
+ @reportclient
+ end
end
# $Id$