[Pkg-puppet-devel] [SCM] Puppet packaging for Debian branch, experimental, updated. debian/2.6.8-1-844-g7ec39d5

Daniel Pittman daniel at puppetlabs.com
Tue May 10 08:17:51 UTC 2011


The following commit has been merged in the experimental branch:
commit c7a0270b872f533c5ba6187b9202a23f9ae8ab23
Author: Daniel Pittman <daniel at puppetlabs.com>
Date:   Thu Apr 21 17:36:35 2011 -0700

    (#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 at puppetlabs.com>

diff --git a/lib/puppet/face/plugin.rb b/lib/puppet/face/plugin.rb
new file mode 100644
index 0000000..4d95bd9
--- /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 a911467..af7ffb7 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

-- 
Puppet packaging for Debian



More information about the Pkg-puppet-devel mailing list