Server IP : 66.29.132.122 / Your IP : 3.138.37.191 Web Server : LiteSpeed System : Linux business142.web-hosting.com 4.18.0-553.lve.el8.x86_64 #1 SMP Mon May 27 15:27:34 UTC 2024 x86_64 User : admazpex ( 531) PHP Version : 7.2.34 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /proc/self/root/proc/self/root/proc/thread-self/root/proc/thread-self/root/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/face/ |
Upload File : |
require_relative '../../puppet/face' require_relative '../../puppet/configurer/plugin_handler' Puppet::Face.define(:plugin, '0.0.1') do copyright "Puppet Inc.", 2011 license _("Apache 2 license; see COPYING") summary _("Interact with the Puppet plugin system.") description <<-'EOT' This subcommand provides network access to the puppet master's store of plugins. The puppet master serves 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. Plugins are normally downloaded by puppet agent during the course of a run. EOT action :download do summary _("Download plugins from the puppet master.") description <<-'EOT' Downloads plugins from the configured puppet master. Any plugins downloaded in this way will be used in all subsequent Puppet activity. This action modifies files on disk. EOT returns _(<<-'EOT') A list of the files downloaded, or a confirmation that no files were downloaded. When used from the Ruby API, this action returns an array of the files downloaded, which will be empty if none were retrieved. EOT examples <<-'EOT' Retrieve plugins from the puppet master: $ puppet plugin download Retrieve plugins from the puppet master (API example): $ Puppet::Face[:plugin, '0.0.1'].download EOT when_invoked do |options| remote_environment_for_plugins = Puppet::Node::Environment.remote(Puppet[:environment]) begin handler = Puppet::Configurer::PluginHandler.new handler.download_plugins(remote_environment_for_plugins) ensure Puppet.runtime[:http].close end end when_rendering :console do |value| if value.empty? then _("No plugins downloaded.") else _("Downloaded these plugins: %{plugins}") % { plugins: value.join(', ') } end end end end