Module: Puppet

Extended by:
Util, Util::Logging
Defined in:
lib/vendor/puppet.rb,
lib/vendor/puppet/type.rb,
lib/vendor/puppet/util.rb,
lib/vendor/puppet/error.rb,
lib/vendor/puppet/version.rb,
lib/vendor/puppet/defaults.rb,
lib/vendor/puppet/type/zfs.rb,
lib/vendor/puppet/type/exec.rb,
lib/vendor/puppet/type/host.rb,
lib/vendor/puppet/type/user.rb,
lib/vendor/puppet/type/group.rb,
lib/vendor/puppet/type/mount.rb,
lib/vendor/puppet/type/zpool.rb,
lib/vendor/puppet/application.rb,
lib/vendor/puppet/module_tool.rb,
lib/vendor/puppet/type/notify.rb,
lib/vendor/puppet/type/router.rb,
lib/vendor/puppet/type/sshkey.rb,
lib/vendor/puppet/parser/lexer.rb,
lib/vendor/puppet/type/package.rb,
lib/vendor/puppet/type/service.rb,
lib/vendor/puppet/type/yumrepo.rb,
lib/vendor/puppet/util/plugins.rb,
lib/vendor/puppet/parser/parser.rb,
lib/vendor/puppet/parser/parser.rb,
lib/vendor/puppet/property/list.rb,
lib/vendor/puppet/transportable.rb,
lib/vendor/puppet/type/maillist.rb,
lib/vendor/puppet/type/schedule.rb,
lib/vendor/puppet/util/classgen.rb,
lib/vendor/puppet/util/platform.rb,
lib/vendor/puppet/util/run_mode.rb,
lib/vendor/puppet/type/file/mode.rb,
lib/vendor/puppet/type/file/type.rb,
lib/vendor/puppet/type/mailalias.rb,
lib/vendor/puppet/resource/status.rb,
lib/vendor/puppet/type/file/ctime.rb,
lib/vendor/puppet/type/file/group.rb,
lib/vendor/puppet/type/file/mtime.rb,
lib/vendor/puppet/type/file/owner.rb,
lib/vendor/puppet/type/filebucket.rb,
lib/vendor/puppet/type/selboolean.rb,
lib/vendor/puppet/util/loadedfile.rb,
lib/vendor/puppet/type/file/ensure.rb,
lib/vendor/puppet/type/file/source.rb,
lib/vendor/puppet/type/file/target.rb,
lib/vendor/puppet/network/authstore.rb,
lib/vendor/puppet/property/keyvalue.rb,
lib/vendor/puppet/type/file/content.rb,
lib/vendor/puppet/util/command_line.rb,
lib/vendor/puppet/network/authconfig.rb,
lib/vendor/puppet/type/file/selcontext.rb,
lib/vendor/puppet/property/ordered_list.rb,
lib/vendor/puppet/network/rest_authconfig.rb,
lib/vendor/puppet/type/ssh_authorized_key.rb,
lib/vendor/puppet/ssl/certificate_authority/interface.rb

Overview

This class is basically a hidden class that knows how to act on the CA. It’s only used by the ‘puppetca’ executable, and its job is to provide a CLI-like interface to the CA class.

Defined Under Namespace

Modules: DSL, FileBucket, FileBucketFile, Forge, Indirector, MetaType, ModuleTool, Network, Parser, Rails, SSL, Test, Util Classes: Agent, AlreadyImportedError, Application, AuthStoreError, AuthorizationError, ConfigurationError, Configurer, ConstantAlreadyDefined, Daemon, DevError, Error, ExecutionFailure, FileCollection, FileServing, ImportError, IniProperty, Interface, LexError, Module, NoSuchFile, Node, Parameter, ParseError, Plugins, Property, Provider, RbTreeMap, Relationship, Reports, Resource, Run, SELFileContext, SimpleGraph, Status, SubclassAlreadyDefined, TransBucket, TransObject, Transaction, Type

Constant Summary collapse

Face =
Puppet::Interface
PUPPETVERSION =
'2.7.20'
Log =

This is for backward compatibility from when we changed the constant to Puppet::Util::Log because the reports include the constant name. Apparently the alias was created in March 2007, should could probably be removed soon.

Puppet::Util::Log
Metric =

This is necessary because we changed the class path in early 2007, and reports directly yaml-dump these metrics, so both client and server have to agree on the class name.

Puppet::Util::Metric
ABSENT_DOC =

Doc string for properties that can be made ‘absent’

"Set this to `absent` to remove it from the file completely."
ResourceType =
self
@@settings =

the hash that determines how our system behaves

Puppet::Util::Settings.new

Constants included from Util

Util::AbsolutePathPosix, Util::AbsolutePathWindows

Class Attribute Summary collapse

Class Method Summary collapse

Methods included from Util

absolute_path?, activerecord_version, benchmark, binread, chuser, classproxy, execfail, execpipe, execute, execute_posix, execute_windows, logmethods, memory, path_to_uri, proxy, replace_file, safe_posix_fork, symbolize, symbolizehash, symbolizehash!, synchronize_on, thinmark, threadlock, uri_to_path, wait_for_output, which, withumask

Methods included from Util::POSIX

#get_posix_field, #gid, #idfield, #methodbyid, #methodbyname, #search_posix_field, #uid

Methods included from Util::Logging

clear_deprecation_warnings, deprecation_warning, send_log

Class Attribute Details

.featuresObject (readonly)

Returns the value of attribute features.



31
32
33
# File 'lib/vendor/puppet.rb', line 31

def features
  @features
end

.name=(value) ⇒ Object (writeonly)

Sets the attribute name

Parameters:

  • value

    the value to set the attribute name to.



32
33
34
# File 'lib/vendor/puppet.rb', line 32

def name=(value)
  @name = value
end

Class Method Details

.[](param) ⇒ Object

configuration parameter access and stuff



57
58
59
60
61
62
63
# File 'lib/vendor/puppet.rb', line 57

def self.[](param)
  if param == :debug
    return Puppet::Util::Log.level == :debug
  else
    return @@settings[param]
  end
end

.[]=(param, value) ⇒ Object

configuration parameter access and stuff



66
67
68
# File 'lib/vendor/puppet.rb', line 66

def self.[]=(param,value)
  @@settings[param] = value
end

.application_nameObject



90
91
92
# File 'lib/vendor/puppet.rb', line 90

def self.application_name
  $puppet_application_name ||= "apply"
end

.clearObject



70
71
72
# File 'lib/vendor/puppet.rb', line 70

def self.clear
  @@settings.clear
end

.debug=(value) ⇒ Object



74
75
76
77
78
79
80
# File 'lib/vendor/puppet.rb', line 74

def self.debug=(value)
  if value
    Puppet::Util::Log.level=(:debug)
  else
    Puppet::Util::Log.level=(:notice)
  end
end

.genmanifestObject



97
98
99
100
101
102
# File 'lib/vendor/puppet.rb', line 97

def self.genmanifest
  if Puppet[:genmanifest]
    puts Puppet.settings.to_manifest
    exit(0)
  end
end

.newtype(name, options = {}, &block) ⇒ Object

Create a new type. Just proxy to the Type class. The mirroring query code was deprecated in 2008, but this is still in heavy use. I suppose this can count as a soft deprecation for the next dev. –daniel 2011-04-12



112
113
114
# File 'lib/vendor/puppet.rb', line 112

def self.newtype(name, options = {}, &block)
  Puppet::Type.newtype(name, options, &block)
end

.parse_configObject

Parse the config file for this process.



105
106
107
# File 'lib/vendor/puppet.rb', line 105

def self.parse_config
  Puppet.settings.parse
end

.run_modeObject



86
87
88
# File 'lib/vendor/puppet.rb', line 86

def self.run_mode
  $puppet_application_mode || Puppet::Util::RunMode[:user]
end

.setdefaults(section, hash) ⇒ Object

Store a new default value.



52
53
54
# File 'lib/vendor/puppet.rb', line 52

def self.setdefaults(section, hash)
  @@settings.setdefaults(section, hash)
end

.settingsObject



82
83
84
# File 'lib/vendor/puppet.rb', line 82

def self.settings
  @@settings
end

.versionObject



11
12
13
# File 'lib/vendor/puppet/version.rb', line 11

def self.version
  @puppet_version || PUPPETVERSION
end

.version=(version) ⇒ Object



15
16
17
# File 'lib/vendor/puppet/version.rb', line 15

def self.version=(version)
  @puppet_version = version
end