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 @@ -1,14 +1,19 @@ require 'puppet/face' Puppet::Face.define(:secret_agent, '0.0.1') do summary "Provides agent-like behavior, with no plugin downloading or reporting." 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