Sha256: c72546b905a557d9c96cc009e42654baf4a946a735383c6b3d98fd959ffe0427

Contents?: true

Size: 1.38 KB

Versions: 23

Compression:

Stored size: 1.38 KB

Contents

require 'puppet/face'

Puppet::Face.define(:config, '0.0.1') do
  copyright "Puppet Labs", 2011
  license   "Apache 2 license; see COPYING"

  summary "Interact with Puppet's configuration options."

  action(:print) do
    summary "Examine Puppet's current configuration settings."
    arguments "(all | <setting> [<setting> ...]"
    returns <<-'EOT'
      A single value when called with one config setting, and a list of
      settings and values when called with multiple options or "all."
    EOT
    description <<-'EOT'
      Prints the value of a single configuration option or a list of
      configuration options.

      This action is an alternate interface to the information available with
      `puppet <subcommand> --configprint`.
    EOT
    notes <<-'EOT'
      By default, this action reads the configuration in agent mode.
      Use the '--run_mode' and '--environment' flags to examine other
      configuration domains.
    EOT
    examples <<-'EOT'
      Get puppet's runfile directory:

      $ puppet config print rundir

      Get a list of important directories from the master's config:

      $ puppet config print all --run_mode master | grep -E "(path|dir)"
    EOT

    when_invoked do |*args|
      options = args.pop

      args = [ "all" ] if args.empty?

      Puppet.settings[:configprint] = args.join(",")
      Puppet.settings.print_config_options
      nil
    end
  end
end

Version data entries

23 entries across 23 versions & 2 rubygems

Version Path
puppet-3.2.4 lib/puppet/face/config.rb
puppet-3.2.3 lib/puppet/face/config.rb
puppet-3.2.3.rc1 lib/puppet/face/config.rb
puppet-3.2.2 lib/puppet/face/config.rb
puppet-3.2.1 lib/puppet/face/config.rb
puppet-3.2.1.rc1 lib/puppet/face/config.rb
puppet-3.2.0.rc2 lib/puppet/face/config.rb
librarian-puppet-0.9.9 vendor/gems/ruby/1.9.1/gems/puppet-3.1.0/lib/puppet/face/config.rb
puppet-3.2.0.rc1 lib/puppet/face/config.rb
puppet-3.1.1 lib/puppet/face/config.rb
librarian-puppet-0.9.8 vendor/gems/ruby/1.9.1/gems/puppet-3.1.0/lib/puppet/face/config.rb
puppet-3.1.0 lib/puppet/face/config.rb
puppet-3.1.0.rc2 lib/puppet/face/config.rb
puppet-3.1.0.rc1 lib/puppet/face/config.rb
puppet-3.0.2 lib/puppet/face/config.rb
puppet-3.0.2.rc3 lib/puppet/face/config.rb
puppet-3.0.2.rc2 lib/puppet/face/config.rb
puppet-3.0.2.rc1 lib/puppet/face/config.rb
puppet-3.0.1 lib/puppet/face/config.rb
puppet-3.0.1.rc1 lib/puppet/face/config.rb