diff options
| author | Daniel Pittman <daniel@puppetlabs.com> | 2011-05-06 11:08:35 -0700 |
|---|---|---|
| committer | Daniel Pittman <daniel@puppetlabs.com> | 2011-05-06 11:08:35 -0700 |
| commit | f80afbe72b848fe4ed81d8116d4eeb494aa6f61e (patch) | |
| tree | 73c7f27f2ea2fb1668f7067ce05638f5064f540d /lib/puppet/face/plugin.rb | |
| parent | 1b12b55b6a2d3581f9643bf09d55727ba1213580 (diff) | |
| parent | b983386ece1b9816e6d3d59a316ad589e35773df (diff) | |
| download | puppet-f80afbe72b848fe4ed81d8116d4eeb494aa6f61e.tar.gz puppet-f80afbe72b848fe4ed81d8116d4eeb494aa6f61e.tar.xz puppet-f80afbe72b848fe4ed81d8116d4eeb494aa6f61e.zip | |
Merge branch '2.7.x' into 2.7.next
Conflicts:
* spec/unit/node/facts_spec.rb
Updates:
* spec/unit/interface/action{,_builder}_spec.rb
=> update for 'when_invoked' block being required.
Diffstat (limited to 'lib/puppet/face/plugin.rb')
| -rw-r--r-- | lib/puppet/face/plugin.rb | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/lib/puppet/face/plugin.rb b/lib/puppet/face/plugin.rb new file mode 100644 index 000000000..969d42389 --- /dev/null +++ b/lib/puppet/face/plugin.rb @@ -0,0 +1,47 @@ +require 'puppet/face' +Puppet::Face.define(:plugin, '0.0.1') do + copyright "Puppet Labs", 2011 + license "Apache 2 license; see COPYING" + + summary "Interact with the Puppet plugin system" + description <<-EOT + This face provides network access to the puppet master's store of + plugins. It is intended for use in other faces, rather than for direct + command line access. + EOT + notes <<-EOT + The puppet master can serve Ruby code collected from the lib directories + of its modules. These plugins can be used on agent nodes to extend + Facter and implement custom types and providers. + EOT + + action :download do + summary "Download plugins from the configured master" + returns <<-EOT + An array containing the files actually downloaded. If all files + were in sync, this array will be empty. + EOT + notes "This action modifies files on disk without returning any data." + examples <<-EOT + Retrieve plugins from the puppet master: + + Puppet::Face[:plugin, '0.0.1'].download + EOT + + when_invoked do |options| + require 'puppet/configurer/downloader' + Puppet::Configurer::Downloader.new("plugin", + Puppet[:plugindest], + Puppet[:pluginsource], + Puppet[:pluginsignore]).evaluate + end + + when_rendering :console do |value| + if value.empty? then + "No plugins downloaded." + else + "Downloaded these plugins: #{value.join(', ')}" + end + end + end +end |
