summaryrefslogtreecommitdiffstats
path: root/lib/puppet/face
diff options
context:
space:
mode:
authorDaniel Pittman <daniel@puppetlabs.com>2011-04-21 17:36:35 -0700
committerDaniel Pittman <daniel@puppetlabs.com>2011-04-21 17:36:35 -0700
commitc7a0270b872f533c5ba6187b9202a23f9ae8ab23 (patch)
tree692664ce3ac1088d8b4ec90aed99ea5dbd52250d /lib/puppet/face
parent3c22e770625f3cc788b0d138c8101e259a534736 (diff)
downloadpuppet-c7a0270b872f533c5ba6187b9202a23f9ae8ab23.tar.gz
puppet-c7a0270b872f533c5ba6187b9202a23f9ae8ab23.tar.xz
puppet-c7a0270b872f533c5ba6187b9202a23f9ae8ab23.zip
(#7121) Download plugins and upload reports in secret agent!
This adds a plugin face, able to download plugins, and wires both that and the report face in to upload the result of the catalog run. This fills out the standard, boring agent behaviour and makes this a semi-credible replacement. Reviewed-By: Max Martin <max@puppetlabs.com>
Diffstat (limited to 'lib/puppet/face')
-rw-r--r--lib/puppet/face/plugin.rb16
-rw-r--r--lib/puppet/face/secret_agent.rb11
2 files changed, 24 insertions, 3 deletions
diff --git a/lib/puppet/face/plugin.rb b/lib/puppet/face/plugin.rb
new file mode 100644
index 000000000..4d95bd93b
--- /dev/null
+++ b/lib/puppet/face/plugin.rb
@@ -0,0 +1,16 @@
+require 'puppet/face'
+Puppet::Face.define(:plugin, '0.0.1') do
+ summary "Interact with the Puppet plugin system"
+
+ action :download do
+ summary "Download plugins from the configured master"
+
+ when_invoked do |options|
+ require 'puppet/configurer/downloader'
+ Puppet::Configurer::Downloader.new("plugin",
+ Puppet[:plugindest],
+ Puppet[:pluginsource],
+ Puppet[:pluginsignore]).evaluate
+ end
+ end
+end
diff --git a/lib/puppet/face/secret_agent.rb b/lib/puppet/face/secret_agent.rb
index a911467f8..af7ffb7b7 100644
--- a/lib/puppet/face/secret_agent.rb
+++ b/lib/puppet/face/secret_agent.rb
@@ -5,10 +5,15 @@ Puppet::Face.define(:secret_agent, '0.0.1') do
action(:synchronize) do
when_invoked do |certname, options|
- facts = Puppet::Face[:facts, '0.0.1'].find(certname)
+ Puppet::Face[:plugin, '0.0.1'].download
+
+ facts = Puppet::Face[:facts, '0.0.1'].find(certname)
catalog = Puppet::Face[:catalog, '0.0.1'].download(certname, facts)
- report = Puppet::Face[:catalog, '0.0.1'].apply(catalog)
- report
+ report = Puppet::Face[:catalog, '0.0.1'].apply(catalog)
+
+ Puppet::Face[:report, '0.0.1'].submit(report)
+
+ return report
end
end
end