source stringclasses 1
value | repo stringlengths 5 63 | repo_url stringlengths 24 82 | path stringlengths 5 167 | language stringclasses 1
value | license stringclasses 5
values | stars int64 10 51.4k | ref stringclasses 23
values | size_bytes int64 200 258k | text stringlengths 137 258k |
|---|---|---|---|---|---|---|---|---|---|
github | puppetlabs/puppet | https://github.com/puppetlabs/puppet | lib/puppet/indirector/facts/yaml.rb | Ruby | apache-2.0 | 7,843 | main | 846 | # frozen_string_literal: true
require_relative '../../../puppet/node/facts'
require_relative '../../../puppet/indirector/yaml'
require_relative '../../../puppet/indirector/fact_search'
class Puppet::Node::Facts::Yaml < Puppet::Indirector::Yaml
desc "Store client facts as flat files, serialized using YAML, or
re... |
github | puppetlabs/puppet | https://github.com/puppetlabs/puppet | lib/puppet/indirector/facts/store_configs.rb | Ruby | apache-2.0 | 7,843 | main | 349 | # frozen_string_literal: true
require_relative '../../../puppet/node/facts'
require_relative '../../../puppet/indirector/store_configs'
class Puppet::Node::Facts::StoreConfigs < Puppet::Indirector::StoreConfigs
desc 'Part of the "storeconfigs" feature. Should not be directly set by end users.'
def allow_remote_r... |
github | puppetlabs/puppet | https://github.com/puppetlabs/puppet | lib/puppet/indirector/facts/network_device.rb | Ruby | apache-2.0 | 7,843 | main | 844 | # frozen_string_literal: true
require_relative '../../../puppet/node/facts'
require_relative '../../../puppet/indirector/code'
class Puppet::Node::Facts::NetworkDevice < Puppet::Indirector::Code
desc "Retrieve facts from a network device."
def allow_remote_requests?
false
end
# Look a device's facts up ... |
github | puppetlabs/puppet | https://github.com/puppetlabs/puppet | lib/puppet/indirector/facts/json.rb | Ruby | apache-2.0 | 7,843 | main | 712 | # frozen_string_literal: true
require_relative '../../../puppet/node/facts'
require_relative '../../../puppet/indirector/json'
require_relative '../../../puppet/indirector/fact_search'
class Puppet::Node::Facts::Json < Puppet::Indirector::JSON
desc "Store client facts as flat files, serialized using JSON, or
re... |
github | puppetlabs/puppet | https://github.com/puppetlabs/puppet | lib/puppet/indirector/facts/rest.rb | Ruby | apache-2.0 | 7,843 | main | 1,348 | # frozen_string_literal: true
require_relative '../../../puppet/node/facts'
require_relative '../../../puppet/indirector/rest'
class Puppet::Node::Facts::Rest < Puppet::Indirector::REST
desc "Find and save facts about nodes over HTTP via REST."
def find(request)
session = Puppet.lookup(:http_session)
api... |
github | puppetlabs/puppet | https://github.com/puppetlabs/puppet | lib/puppet/indirector/node/rest.rb | Ruby | apache-2.0 | 7,843 | main | 1,026 | # frozen_string_literal: true
require_relative '../../../puppet/node'
require_relative '../../../puppet/indirector/rest'
class Puppet::Node::Rest < Puppet::Indirector::REST
desc "Get a node via REST. Puppet agent uses this to allow the puppet master
to override its environment."
def find(request)
session... |
github | puppetlabs/puppet | https://github.com/puppetlabs/puppet | lib/puppet/indirector/node/json.rb | Ruby | apache-2.0 | 7,843 | main | 287 | # frozen_string_literal: true
require_relative '../../../puppet/node'
require_relative '../../../puppet/indirector/json'
class Puppet::Node::Json < Puppet::Indirector::JSON
desc "Store node information as flat files, serialized using JSON,
or deserialize stored JSON nodes."
end |
github | puppetlabs/puppet | https://github.com/puppetlabs/puppet | lib/puppet/indirector/node/memory.rb | Ruby | apache-2.0 | 7,843 | main | 502 | # frozen_string_literal: true
require_relative '../../../puppet/node'
require_relative '../../../puppet/indirector/memory'
class Puppet::Node::Memory < Puppet::Indirector::Memory
desc "Keep track of nodes in memory but nowhere else. This is used for
one-time compiles, such as what the stand-alone `puppet` does... |
github | puppetlabs/puppet | https://github.com/puppetlabs/puppet | lib/puppet/indirector/node/plain.rb | Ruby | apache-2.0 | 7,843 | main | 806 | # frozen_string_literal: true
require_relative '../../../puppet/node'
require_relative '../../../puppet/indirector/plain'
class Puppet::Node::Plain < Puppet::Indirector::Plain
desc "Always return an empty node object. Assumes you keep track of nodes
in flat file manifests. You should use it when you don't have... |
github | puppetlabs/puppet | https://github.com/puppetlabs/puppet | lib/puppet/indirector/node/yaml.rb | Ruby | apache-2.0 | 7,843 | main | 287 | # frozen_string_literal: true
require_relative '../../../puppet/node'
require_relative '../../../puppet/indirector/yaml'
class Puppet::Node::Yaml < Puppet::Indirector::Yaml
desc "Store node information as flat files, serialized using YAML,
or deserialize stored YAML nodes."
end |
github | puppetlabs/puppet | https://github.com/puppetlabs/puppet | lib/puppet/indirector/node/exec.rb | Ruby | apache-2.0 | 7,843 | main | 2,191 | # frozen_string_literal: true
require_relative '../../../puppet/node'
require_relative '../../../puppet/indirector/exec'
class Puppet::Node::Exec < Puppet::Indirector::Exec
desc "Call an external program to get node information. See
the [External Nodes](https://puppet.com/docs/puppet/latest/lang_write_functions_... |
github | puppetlabs/puppet | https://github.com/puppetlabs/puppet | lib/puppet/indirector/node/msgpack.rb | Ruby | apache-2.0 | 7,843 | main | 310 | # frozen_string_literal: true
require_relative '../../../puppet/node'
require_relative '../../../puppet/indirector/msgpack'
class Puppet::Node::Msgpack < Puppet::Indirector::Msgpack
desc "Store node information as flat files, serialized using MessagePack,
or deserialize stored MessagePack nodes."
end |
github | puppetlabs/puppet | https://github.com/puppetlabs/puppet | lib/puppet/indirector/node/store_configs.rb | Ruby | apache-2.0 | 7,843 | main | 290 | # frozen_string_literal: true
require_relative '../../../puppet/indirector/store_configs'
require_relative '../../../puppet/node'
class Puppet::Node::StoreConfigs < Puppet::Indirector::StoreConfigs
desc 'Part of the "storeconfigs" feature. Should not be directly set by end users.'
end |
github | puppetlabs/puppet | https://github.com/puppetlabs/puppet | lib/puppet/indirector/resource/validator.rb | Ruby | apache-2.0 | 7,843 | main | 344 | # frozen_string_literal: true
module Puppet::Resource::Validator
def validate_key(request)
type, title = request.key.split('/', 2)
unless type.casecmp(request.instance.type).zero? and title == request.instance.title
raise Puppet::Indirector::ValidationError, _("Resource instance does not match request ... |
github | puppetlabs/puppet | https://github.com/puppetlabs/puppet | lib/puppet/indirector/resource/store_configs.rb | Ruby | apache-2.0 | 7,843 | main | 404 | # frozen_string_literal: true
require_relative '../../../puppet/indirector/store_configs'
require_relative '../../../puppet/indirector/resource/validator'
class Puppet::Resource::StoreConfigs < Puppet::Indirector::StoreConfigs
include Puppet::Resource::Validator
desc 'Part of the "storeconfigs" feature. Should n... |
github | puppetlabs/puppet | https://github.com/puppetlabs/puppet | lib/puppet/indirector/resource/ral.rb | Ruby | apache-2.0 | 7,843 | main | 2,042 | # frozen_string_literal: true
require_relative '../../../puppet/indirector/resource/validator'
class Puppet::Resource::Ral < Puppet::Indirector::Code
include Puppet::Resource::Validator
desc "Manipulate resources with the resource abstraction layer. Only used internally."
def allow_remote_requests?
false
... |
github | puppetlabs/puppet | https://github.com/puppetlabs/puppet | lib/puppet/indirector/data_binding/none.rb | Ruby | apache-2.0 | 7,843 | main | 271 | # frozen_string_literal: true
require_relative '../../../puppet/indirector/none'
class Puppet::DataBinding::None < Puppet::Indirector::None
desc "A Dummy terminus that always throws :no_such_key for data lookups."
def find(request)
throw :no_such_key
end
end |
github | puppetlabs/puppet | https://github.com/puppetlabs/puppet | lib/puppet/indirector/data_binding/hiera.rb | Ruby | apache-2.0 | 7,843 | main | 207 | # frozen_string_literal: true
require_relative '../../../puppet/indirector/hiera'
require 'hiera/scope'
class Puppet::DataBinding::Hiera < Puppet::Indirector::Hiera
desc "Retrieve data using Hiera."
end |
github | puppetlabs/puppet | https://github.com/puppetlabs/puppet | lib/puppet/indirector/file_bucket_file/selector.rb | Ruby | apache-2.0 | 7,843 | main | 1,074 | # frozen_string_literal: true
require_relative '../../../puppet/indirector/code'
module Puppet::FileBucketFile
class Selector < Puppet::Indirector::Code
desc "Select the terminus based on the request"
def select(request)
if request.protocol == 'https'
:rest
else
:file
end
... |
github | puppetlabs/puppet | https://github.com/puppetlabs/puppet | lib/puppet/indirector/file_bucket_file/file.rb | Ruby | apache-2.0 | 7,843 | main | 11,630 | # frozen_string_literal: true
require_relative '../../../puppet/indirector/code'
require_relative '../../../puppet/file_bucket/file'
require_relative '../../../puppet/util/checksums'
require_relative '../../../puppet/util/diff'
require 'fileutils'
module Puppet::FileBucketFile
class File < Puppet::Indirector::Code
... |
github | puppetlabs/puppet | https://github.com/puppetlabs/puppet | lib/puppet/indirector/file_bucket_file/rest.rb | Ruby | apache-2.0 | 7,843 | main | 1,645 | # frozen_string_literal: true
require_relative '../../../puppet/indirector/rest'
require_relative '../../../puppet/file_bucket/file'
module Puppet::FileBucketFile
class Rest < Puppet::Indirector::REST
desc "This is a REST based mechanism to send/retrieve file to/from the filebucket"
def head(request)
... |
github | puppetlabs/puppet | https://github.com/puppetlabs/puppet | lib/puppet/indirector/report/processor.rb | Ruby | apache-2.0 | 7,843 | main | 1,775 | # frozen_string_literal: true
require_relative '../../../puppet/transaction/report'
require_relative '../../../puppet/indirector/code'
require_relative '../../../puppet/reports'
class Puppet::Transaction::Report::Processor < Puppet::Indirector::Code
desc "Puppet's report processor. Processes the report with each o... |
github | puppetlabs/puppet | https://github.com/puppetlabs/puppet | lib/puppet/indirector/report/json.rb | Ruby | apache-2.0 | 7,843 | main | 1,084 | # frozen_string_literal: true
require_relative '../../../puppet/transaction/report'
require_relative '../../../puppet/indirector/json'
class Puppet::Transaction::Report::Json < Puppet::Indirector::JSON
include Puppet::Util::SymbolicFileMode
desc "Store last report as a flat file, serialized using JSON."
# For... |
github | puppetlabs/puppet | https://github.com/puppetlabs/puppet | lib/puppet/indirector/report/rest.rb | Ruby | apache-2.0 | 7,843 | main | 837 | # frozen_string_literal: true
require_relative '../../../puppet/indirector/rest'
require 'semantic_puppet'
class Puppet::Transaction::Report::Rest < Puppet::Indirector::REST
desc "Get server report over HTTP via REST."
def save(request)
session = Puppet.lookup(:http_session)
api = session.route_to(:repor... |
github | puppetlabs/puppet | https://github.com/puppetlabs/puppet | lib/puppet/indirector/report/yaml.rb | Ruby | apache-2.0 | 7,843 | main | 1,084 | # frozen_string_literal: true
require_relative '../../../puppet/transaction/report'
require_relative '../../../puppet/indirector/yaml'
class Puppet::Transaction::Report::Yaml < Puppet::Indirector::Yaml
include Puppet::Util::SymbolicFileMode
desc "Store last report as a flat file, serialized using YAML."
# For... |
github | puppetlabs/puppet | https://github.com/puppetlabs/puppet | lib/puppet/indirector/report/msgpack.rb | Ruby | apache-2.0 | 7,843 | main | 394 | # frozen_string_literal: true
require_relative '../../../puppet/transaction/report'
require_relative '../../../puppet/indirector/msgpack'
class Puppet::Transaction::Report::Msgpack < Puppet::Indirector::Msgpack
desc "Store last report as a flat file, serialized using MessagePack."
# Force report to be saved ther... |
github | puppetlabs/puppet | https://github.com/puppetlabs/puppet | lib/puppet/indirector/file_content/file.rb | Ruby | apache-2.0 | 7,843 | main | 342 | # frozen_string_literal: true
require_relative '../../../puppet/file_serving/content'
require_relative '../../../puppet/indirector/file_content'
require_relative '../../../puppet/indirector/direct_file_server'
class Puppet::Indirector::FileContent::File < Puppet::Indirector::DirectFileServer
desc "Retrieve file con... |
github | puppetlabs/puppet | https://github.com/puppetlabs/puppet | lib/puppet/indirector/file_content/file_server.rb | Ruby | apache-2.0 | 7,843 | main | 351 | # frozen_string_literal: true
require_relative '../../../puppet/file_serving/content'
require_relative '../../../puppet/indirector/file_content'
require_relative '../../../puppet/indirector/file_server'
class Puppet::Indirector::FileContent::FileServer < Puppet::Indirector::FileServer
desc "Retrieve file contents u... |
github | puppetlabs/puppet | https://github.com/puppetlabs/puppet | lib/puppet/indirector/file_content/selector.rb | Ruby | apache-2.0 | 7,843 | main | 833 | # frozen_string_literal: true
require_relative '../../../puppet/file_serving/content'
require_relative '../../../puppet/indirector/file_content'
require_relative '../../../puppet/indirector/code'
require_relative '../../../puppet/file_serving/terminus_selector'
class Puppet::Indirector::FileContent::Selector < Puppet... |
github | puppetlabs/puppet | https://github.com/puppetlabs/puppet | lib/puppet/indirector/file_content/rest.rb | Ruby | apache-2.0 | 7,843 | main | 1,176 | # frozen_string_literal: true
require_relative '../../../puppet/file_serving/content'
require_relative '../../../puppet/indirector/file_content'
require_relative '../../../puppet/indirector/rest'
class Puppet::Indirector::FileContent::Rest < Puppet::Indirector::REST
desc "Retrieve file contents via a REST HTTP inte... |
github | puppetlabs/puppet | https://github.com/puppetlabs/puppet | lib/puppet/indirector/catalog/yaml.rb | Ruby | apache-2.0 | 7,843 | main | 266 | # frozen_string_literal: true
require_relative '../../../puppet/resource/catalog'
require_relative '../../../puppet/indirector/yaml'
class Puppet::Resource::Catalog::Yaml < Puppet::Indirector::Yaml
desc "Store catalogs as flat files, serialized using YAML."
end |
github | puppetlabs/puppet | https://github.com/puppetlabs/puppet | lib/puppet/indirector/catalog/store_configs.rb | Ruby | apache-2.0 | 7,843 | main | 315 | # frozen_string_literal: true
require_relative '../../../puppet/indirector/store_configs'
require_relative '../../../puppet/resource/catalog'
class Puppet::Resource::Catalog::StoreConfigs < Puppet::Indirector::StoreConfigs
desc 'Part of the "storeconfigs" feature. Should not be directly set by end users.'
end |
github | puppetlabs/puppet | https://github.com/puppetlabs/puppet | lib/puppet/indirector/catalog/compiler.rb | Ruby | apache-2.0 | 7,843 | main | 19,344 | # frozen_string_literal: true
require_relative '../../../puppet/environments'
require_relative '../../../puppet/node'
require_relative '../../../puppet/node/server_facts'
require_relative '../../../puppet/resource/catalog'
require_relative '../../../puppet/indirector/code'
require_relative '../../../puppet/util/profil... |
github | puppetlabs/puppet | https://github.com/puppetlabs/puppet | lib/puppet/indirector/catalog/rest.rb | Ruby | apache-2.0 | 7,843 | main | 1,772 | # frozen_string_literal: true
require_relative '../../../puppet/resource/catalog'
require_relative '../../../puppet/indirector/rest'
class Puppet::Resource::Catalog::Rest < Puppet::Indirector::REST
desc "Find resource catalogs over HTTP via REST."
def find(request)
checksum_type = if request.options[:checksu... |
github | puppetlabs/puppet | https://github.com/puppetlabs/puppet | lib/puppet/indirector/catalog/json.rb | Ruby | apache-2.0 | 7,843 | main | 1,289 | # frozen_string_literal: true
require_relative '../../../puppet/resource/catalog'
require_relative '../../../puppet/indirector/json'
class Puppet::Resource::Catalog::Json < Puppet::Indirector::JSON
desc "Store catalogs as flat files, serialized using JSON."
def from_json(text)
utf8 = text.force_encoding(Enco... |
github | puppetlabs/puppet | https://github.com/puppetlabs/puppet | lib/puppet/indirector/catalog/msgpack.rb | Ruby | apache-2.0 | 7,843 | main | 282 | # frozen_string_literal: true
require_relative '../../../puppet/resource/catalog'
require_relative '../../../puppet/indirector/msgpack'
class Puppet::Resource::Catalog::Msgpack < Puppet::Indirector::Msgpack
desc "Store catalogs as flat files, serialized using MessagePack."
end |
github | puppetlabs/puppet | https://github.com/puppetlabs/puppet | lib/puppet/graph/rb_tree_map.rb | Ruby | apache-2.0 | 7,843 | main | 10,033 | # frozen_string_literal: true
# Algorithms and Containers project is Copyright (c) 2009 Kanwei Li
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the 'Software'), to deal
# in the Software without restriction, including without lim... |
github | puppetlabs/puppet | https://github.com/puppetlabs/puppet | lib/puppet/graph/relationship_graph.rb | Ruby | apache-2.0 | 7,843 | main | 8,808 | # frozen_string_literal: true
# The relationship graph is the final form of a puppet catalog in
# which all dependency edges are explicitly in the graph. This form of the
# catalog is used to traverse the graph in the order in which resources are
# managed.
#
# @api private
class Puppet::Graph::RelationshipGraph < Pup... |
github | puppetlabs/puppet | https://github.com/puppetlabs/puppet | lib/puppet/graph/sequential_prioritizer.rb | Ruby | apache-2.0 | 7,843 | main | 961 | # frozen_string_literal: true
# This implements a priority in which keys are given values that will keep them
# in the same priority in which they priorities are requested. Nested
# structures (those in which a key is contained within another key) are
# preserved in such a way that child keys are after the parent and ... |
github | puppetlabs/puppet | https://github.com/puppetlabs/puppet | lib/puppet/graph/key.rb | Ruby | apache-2.0 | 7,843 | main | 492 | # frozen_string_literal: true
# Sequential, nestable keys for tracking order of insertion in "the graph"
# @api private
class Puppet::Graph::Key
include Comparable
attr_reader :value
protected :value
def initialize(value = [0])
@value = value
end
def next
next_values = @value.clone
next_valu... |
github | puppetlabs/puppet | https://github.com/puppetlabs/puppet | lib/puppet/graph/simple_graph.rb | Ruby | apache-2.0 | 7,843 | main | 18,013 | # frozen_string_literal: true
require_relative '../../puppet/external/dot'
require_relative '../../puppet/relationship'
require 'set'
# A hopefully-faster graph class to replace the use of GRATR.
class Puppet::Graph::SimpleGraph
include Puppet::Util::PsychSupport
#
# All public methods of this class must maint... |
github | puppetlabs/puppet | https://github.com/puppetlabs/puppet | lib/puppet/graph/prioritizer.rb | Ruby | apache-2.0 | 7,843 | main | 566 | # frozen_string_literal: true
# Base, template method, class for Prioritizers. This provides the basic
# tracking facilities used.
#
# @api private
class Puppet::Graph::Prioritizer
def initialize
@priority = {}
end
def forget(key)
@priority.delete(key)
end
def record_priority_for(key, priority)
... |
github | puppetlabs/puppet | https://github.com/puppetlabs/puppet | lib/puppet/transaction/event.rb | Ruby | apache-2.0 | 7,843 | main | 5,437 | # frozen_string_literal: true
require_relative '../../puppet/transaction'
require_relative '../../puppet/util/tagging'
require_relative '../../puppet/util/logging'
require_relative '../../puppet/network/format_support'
# A simple struct for storing what happens on the system.
class Puppet::Transaction::Event
includ... |
github | puppetlabs/puppet | https://github.com/puppetlabs/puppet | lib/puppet/transaction/persistence.rb | Ruby | apache-2.0 | 7,843 | main | 4,330 | # frozen_string_literal: true
require 'yaml'
require_relative '../../puppet/util/yaml'
# A persistence store implementation for storing information between
# transaction runs for the purposes of information inference (such
# as calculating corrective_change).
# @api private
class Puppet::Transaction::Persistence
de... |
github | puppetlabs/puppet | https://github.com/puppetlabs/puppet | lib/puppet/transaction/resource_harness.rb | Ruby | apache-2.0 | 7,843 | main | 12,677 | # frozen_string_literal: true
require_relative '../../puppet/resource/status'
class Puppet::Transaction::ResourceHarness
NO_ACTION = Object.new
extend Forwardable
def_delegators :@transaction, :relationship_graph
attr_reader :transaction
def initialize(transaction)
@transaction = transaction
@per... |
github | puppetlabs/puppet | https://github.com/puppetlabs/puppet | lib/puppet/transaction/additional_resource_generator.rb | Ruby | apache-2.0 | 7,843 | main | 8,304 | # frozen_string_literal: true
# Adds additional resources to the catalog and relationship graph that are
# generated by existing resources. There are two ways that a resource can
# generate additional resources, either through the #generate method or the
# #eval_generate method.
#
# @api private
class Puppet::Transact... |
github | puppetlabs/puppet | https://github.com/puppetlabs/puppet | lib/puppet/transaction/report.rb | Ruby | apache-2.0 | 7,843 | main | 15,589 | # frozen_string_literal: true
require_relative '../../puppet'
require_relative '../../puppet/indirector'
# This class is used to report what happens on a client.
# There are two types of data in a report; _Logs_ and _Metrics_.
#
# * **Logs** - are the output that each change produces.
# * **Metrics** - are all of the... |
github | puppetlabs/puppet | https://github.com/puppetlabs/puppet | lib/puppet/transaction/event_manager.rb | Ruby | apache-2.0 | 7,843 | main | 6,788 | # frozen_string_literal: true
require_relative '../../puppet/transaction'
# This class stores, routes, and responds to events generated while evaluating
# a transaction.
#
# @api private
class Puppet::Transaction::EventManager
# @!attribute [r] transaction
# @return [Puppet::Transaction] The transaction associa... |
github | puppetlabs/puppet | https://github.com/puppetlabs/puppet | lib/puppet/reference/indirection.rb | Ruby | apache-2.0 | 7,843 | main | 3,870 | # frozen_string_literal: true
require_relative '../../puppet/indirector/indirection'
require_relative '../../puppet/util/checksums'
require_relative '../../puppet/file_serving/content'
require_relative '../../puppet/file_serving/metadata'
reference = Puppet::Util::Reference.newreference :indirection, :doc => "Indirec... |
github | puppetlabs/puppet | https://github.com/puppetlabs/puppet | lib/puppet/reference/report.rb | Ruby | apache-2.0 | 7,843 | main | 786 | # frozen_string_literal: true
require_relative '../../puppet/reports'
report = Puppet::Util::Reference.newreference :report, :doc => "All available transaction reports" do
Puppet::Reports.reportdocs
end
report.header = "
Puppet can generate a report after applying a catalog. This report includes
events, log messag... |
github | puppetlabs/puppet | https://github.com/puppetlabs/puppet | lib/puppet/reference/metaparameter.rb | Ruby | apache-2.0 | 7,843 | main | 1,035 | # frozen_string_literal: true
Puppet::Util::Reference.newreference :metaparameter, :doc => "All Puppet metaparameters and all their details" do
str = %{
Metaparameters are attributes that work with any resource type, including custom
types and defined types.
In general, they affect _Puppet's_ behavior rather than ... |
github | puppetlabs/puppet | https://github.com/puppetlabs/puppet | lib/puppet/reference/type.rb | Ruby | apache-2.0 | 7,843 | main | 3,390 | # frozen_string_literal: true
Puppet::Util::Reference.newreference :type, :doc => "All Puppet resource types and all their details" do
types = {}
Puppet::Type.loadall
Puppet::Type.eachtype { |type|
next if type.name == :component
next if type.name == :whit
types[type.name] = type
}
str = %{
#... |
github | puppetlabs/puppet | https://github.com/puppetlabs/puppet | lib/puppet/reference/configuration.rb | Ruby | apache-2.0 | 7,843 | main | 4,663 | # frozen_string_literal: true
config = Puppet::Util::Reference.newreference(:configuration, :depth => 1, :doc => "A reference for all settings") do
docs = {}
Puppet.settings.each do |name, object|
docs[name] = object
end
str = ''.dup
docs.sort { |a, b|
a[0].to_s <=> b[0].to_s
}.each do |name, obje... |
github | puppetlabs/puppet | https://github.com/puppetlabs/puppet | lib/puppet/reference/providers.rb | Ruby | apache-2.0 | 7,843 | main | 4,026 | # frozen_string_literal: true
providers = Puppet::Util::Reference.newreference :providers, :title => "Provider Suitability Report", :depth => 1, :dynamic => true, :doc => "Which providers are valid for this machine" do
types = []
Puppet::Type.loadall
Puppet::Type.eachtype do |klass|
next unless klass && klas... |
github | puppetlabs/puppet | https://github.com/puppetlabs/puppet | lib/puppet/reference/function.rb | Ruby | apache-2.0 | 7,843 | main | 737 | # frozen_string_literal: true
function = Puppet::Util::Reference.newreference :function, :doc => "All functions available in the parser" do
Puppet::Parser::Functions.functiondocs
end
function.header = "
There are two types of functions in Puppet: Statements and rvalues.
Statements stand on their own and do not retur... |
github | puppetlabs/puppet | https://github.com/puppetlabs/puppet | lib/puppet/test/test_helper.rb | Ruby | apache-2.0 | 7,843 | main | 10,513 | # frozen_string_literal: true
require 'tmpdir'
require 'fileutils'
module Puppet::Test
# This class is intended to provide an API to be used by external projects
# when they are running tests that depend on puppet core. This should
# allow us to vary the implementation details of managing puppet's state
# ... |
github | puppetlabs/puppet | https://github.com/puppetlabs/puppet | lib/puppet/ssl/base.rb | Ruby | apache-2.0 | 7,843 | main | 4,345 | # frozen_string_literal: true
require_relative '../../puppet/ssl/openssl_loader'
require_relative '../../puppet/ssl'
require_relative '../../puppet/ssl/digest'
# The base class for wrapping SSL instances.
class Puppet::SSL::Base
# For now, use the YAML separator.
SEPARATOR = "\n---\n"
# Only allow printing asc... |
github | puppetlabs/puppet | https://github.com/puppetlabs/puppet | lib/puppet/ssl/verifier.rb | Ruby | apache-2.0 | 7,843 | main | 5,970 | # frozen_string_literal: true
require_relative '../../puppet/ssl'
# Verify an SSL connection.
#
# @api private
class Puppet::SSL::Verifier
FIVE_MINUTES_AS_SECONDS = 5 * 60
attr_reader :ssl_context
# Create a verifier using an `ssl_context`.
#
# @param hostname [String] FQDN of the server we're attempting ... |
github | puppetlabs/puppet | https://github.com/puppetlabs/puppet | lib/puppet/ssl/openssl_loader.rb | Ruby | apache-2.0 | 7,843 | main | 720 | # frozen_string_literal: true
require_relative '../../puppet/util/platform'
# This file should be required instead of writing `require 'openssl'`
# or any library that loads openssl like `net/https`. This allows the
# core Puppet code to load correctly in JRuby environments that do not
# have a functioning openssl (e... |
github | puppetlabs/puppet | https://github.com/puppetlabs/puppet | lib/puppet/ssl/error.rb | Ruby | apache-2.0 | 7,843 | main | 955 | # frozen_string_literal: true
module Puppet::SSL
class SSLError < Puppet::Error; end
class CertVerifyError < Puppet::SSL::SSLError
attr_reader :code, :cert
def initialize(message, code, cert)
super(message)
@code = code
@cert = cert
end
end
class CertMismatchError < Puppet::SSL... |
github | puppetlabs/puppet | https://github.com/puppetlabs/puppet | lib/puppet/ssl/state_machine.rb | Ruby | apache-2.0 | 7,843 | main | 21,856 | # frozen_string_literal: true
require_relative '../../puppet/ssl'
require_relative '../../puppet/util/pidlock'
# This class implements a state machine for bootstrapping a host's CA and CRL
# bundles, private key and signed client certificate. Each state has a frozen
# SSLContext that it uses to make network connectio... |
github | puppetlabs/puppet | https://github.com/puppetlabs/puppet | lib/puppet/ssl/ssl_context.rb | Ruby | apache-2.0 | 7,843 | main | 596 | # frozen_string_literal: true
require_relative '../../puppet/ssl'
module Puppet::SSL
# The `keyword_init: true` option is no longer needed in Ruby >= 3.2
SSLContext = Struct.new(
:store,
:cacerts,
:crls,
:private_key,
:client_cert,
:client_chain,
:revocation,
:verify_peer,
keyw... |
github | puppetlabs/puppet | https://github.com/puppetlabs/puppet | lib/puppet/ssl/digest.rb | Ruby | apache-2.0 | 7,843 | main | 364 | # frozen_string_literal: true
class Puppet::SSL::Digest
attr_reader :digest
def initialize(algorithm, content)
algorithm ||= 'SHA256'
@digest = OpenSSL::Digest.new(algorithm, content)
end
def to_s
"(#{name}) #{to_hex}"
end
def to_hex
@digest.hexdigest.scan(/../).join(':').upcase
end
... |
github | puppetlabs/puppet | https://github.com/puppetlabs/puppet | lib/puppet/ssl/certificate_signer.rb | Ruby | apache-2.0 | 7,843 | main | 1,168 | # frozen_string_literal: true
# Take care of signing a certificate in a FIPS 140-2 compliant manner.
#
# @see https://projects.puppetlabs.com/issues/17295
#
# @api private
class Puppet::SSL::CertificateSigner
# @!attribute [r] digest
# @return [OpenSSL::Digest]
attr_reader :digest
def initialize
if Open... |
github | puppetlabs/puppet | https://github.com/puppetlabs/puppet | lib/puppet/ssl/certificate_request.rb | Ruby | apache-2.0 | 7,843 | main | 12,825 | # frozen_string_literal: true
require_relative '../../puppet/ssl/base'
require_relative '../../puppet/ssl/certificate_signer'
# This class creates and manages X509 certificate signing requests.
#
# ## CSR attributes
#
# CSRs may contain a set of attributes that includes supplementary information
# about the CSR or in... |
github | puppetlabs/puppet | https://github.com/puppetlabs/puppet | lib/puppet/ssl/oids.rb | Ruby | apache-2.0 | 7,843 | main | 8,995 | # frozen_string_literal: true
require_relative '../../puppet/ssl'
# This module defines OIDs for use within Puppet.
#
# # ASN.1 Definition
#
# The following is the formal definition of OIDs specified in this file.
#
# ```
# puppetCertExtensions OBJECT IDENTIFIER ::= {iso(1) identified-organization(3)
# dod(6) inte... |
github | puppetlabs/puppet | https://github.com/puppetlabs/puppet | lib/puppet/ssl/ssl_provider.rb | Ruby | apache-2.0 | 7,843 | main | 15,738 | # frozen_string_literal: true
require_relative '../../puppet/ssl'
# SSL Provider creates `SSLContext` objects that can be used to create
# secure connections.
#
# @example To load an SSLContext from an existing private key and related certs/crls:
# ssl_context = provider.load_context
#
# @example To load an SSLCont... |
github | puppetlabs/puppet | https://github.com/puppetlabs/puppet | lib/puppet/ssl/certificate.rb | Ruby | apache-2.0 | 7,843 | main | 3,044 | # frozen_string_literal: true
require_relative '../../puppet/ssl/base'
# Manage certificates themselves. This class has no
# 'generate' method because the CA is responsible
# for turning CSRs into certificates; we can only
# retrieve them from the CA (or not, as is often
# the case).
#
# @deprecated Use {Puppet::SSL... |
github | puppetlabs/puppet | https://github.com/puppetlabs/puppet | lib/puppet/ssl/certificate_request_attributes.rb | Ruby | apache-2.0 | 7,843 | main | 1,381 | # frozen_string_literal: true
require_relative '../../puppet/ssl'
require_relative '../../puppet/util/yaml'
# This class transforms simple key/value pairs into the equivalent ASN1
# structures. Values may be strings or arrays of strings.
#
# @api private
class Puppet::SSL::CertificateRequestAttributes
attr_reader :... |
github | puppetlabs/puppet | https://github.com/puppetlabs/puppet | lib/puppet/agent/disabler.rb | Ruby | apache-2.0 | 7,843 | main | 1,499 | # frozen_string_literal: true
require_relative '../../puppet/util/json_lockfile'
# This module is responsible for encapsulating the logic for
# "disabling" the puppet agent during a run; in other words,
# keeping track of enough state to answer the question
# "has the puppet agent been administratively disabled?"
... |
github | puppetlabs/puppet | https://github.com/puppetlabs/puppet | lib/puppet/agent/locker.rb | Ruby | apache-2.0 | 7,843 | main | 1,238 | # frozen_string_literal: true
require_relative '../../puppet/util/pidlock'
require_relative '../../puppet/error'
# This module is responsible for encapsulating the logic for "locking" the
# puppet agent during a catalog run; in other words, keeping track of enough
# state to answer the question "is there a puppet age... |
github | puppetlabs/puppet | https://github.com/puppetlabs/puppet | lib/puppet/generate/type.rb | Ruby | apache-2.0 | 7,843 | main | 10,003 | # frozen_string_literal: true
require 'erb'
require 'fileutils'
require_relative '../../puppet/util/autoload'
require_relative '../../puppet/generate/models/type/type'
module Puppet
module Generate
# Responsible for generating type definitions in Puppet
class Type
# Represents an input to the type gen... |
github | puppetlabs/puppet | https://github.com/puppetlabs/puppet | lib/puppet/generate/models/type/type.rb | Ruby | apache-2.0 | 7,843 | main | 2,219 | # frozen_string_literal: true
require_relative '../../../../puppet/generate/models/type/property'
module Puppet
module Generate
module Models
module Type
# A model for Puppet resource types.
class Type
# Gets the name of the type as a Puppet string literal.
attr_reader ... |
github | puppetlabs/puppet | https://github.com/puppetlabs/puppet | lib/puppet/generate/models/type/property.rb | Ruby | apache-2.0 | 7,843 | main | 2,873 | # frozen_string_literal: true
module Puppet
module Generate
module Models
module Type
# A model for resource type properties and parameters.
class Property
# Gets the name of the property as a Puppet string literal.
attr_reader :name
# Gets the Puppet type of ... |
github | puppetlabs/puppet | https://github.com/puppetlabs/puppet | lib/puppet/resource/status.rb | Ruby | apache-2.0 | 7,843 | main | 8,200 | # frozen_string_literal: true
require 'time'
require_relative '../../puppet/network/format_support'
require_relative '../../puppet/util/psych_support'
module Puppet
class Resource
# This class represents the result of evaluating a given resource. It
# contains file and line information about the source, eve... |
github | puppetlabs/puppet | https://github.com/puppetlabs/puppet | lib/puppet/resource/type_collection.rb | Ruby | apache-2.0 | 7,843 | main | 6,932 | # frozen_string_literal: true
require_relative '../../puppet/parser/type_loader'
require_relative '../../puppet/util/file_watcher'
require_relative '../../puppet/util/warnings'
require_relative '../../puppet/concurrent/lock'
# @api private
class Puppet::Resource::TypeCollection
attr_reader :environment
attr_acces... |
github | puppetlabs/puppet | https://github.com/puppetlabs/puppet | lib/puppet/resource/catalog.rb | Ruby | apache-2.0 | 7,843 | main | 21,956 | # frozen_string_literal: true
require_relative '../../puppet/node'
require_relative '../../puppet/indirector'
require_relative '../../puppet/transaction'
require_relative '../../puppet/util/tagging'
require_relative '../../puppet/graph'
require 'securerandom'
# This class models a node catalog. It is the thing meant... |
github | puppetlabs/puppet | https://github.com/puppetlabs/puppet | lib/puppet/resource/type.rb | Ruby | apache-2.0 | 7,843 | main | 15,525 | # frozen_string_literal: true
require_relative '../../puppet/parser'
require_relative '../../puppet/util/warnings'
require_relative '../../puppet/util/errors'
require_relative '../../puppet/parser/ast/leaf'
# Puppet::Resource::Type represents nodes, classes and defined types.
#
# @api public
class Puppet::Resource::T... |
github | puppetlabs/puppet | https://github.com/puppetlabs/puppet | lib/puppet/reports/store.rb | Ruby | apache-2.0 | 7,843 | main | 1,978 | # frozen_string_literal: true
require_relative '../../puppet'
require 'fileutils'
require_relative '../../puppet/util'
SEPARATOR = [Regexp.escape(File::SEPARATOR.to_s), Regexp.escape(File::ALT_SEPARATOR.to_s)].join
Puppet::Reports.register_report(:store) do
desc "Store the yaml report on disk. Each host sends its... |
github | puppetlabs/puppet | https://github.com/puppetlabs/puppet | lib/puppet/reports/http.rb | Ruby | apache-2.0 | 7,843 | main | 1,741 | # frozen_string_literal: true
require_relative '../../puppet'
require_relative '../../puppet/network/http_pool'
require 'uri'
Puppet::Reports.register_report(:http) do
desc <<-DESC
Send reports via HTTP or HTTPS. This report processor submits reports as
POST requests to the address in the `reporturl` settin... |
github | puppetlabs/puppet | https://github.com/puppetlabs/puppet | lib/puppet/reports/log.rb | Ruby | apache-2.0 | 7,843 | main | 361 | # frozen_string_literal: true
require_relative '../../puppet/reports'
Puppet::Reports.register_report(:log) do
desc "Send all received logs to the local log destinations. Usually
the log destination is syslog."
def process
logs.each do |log|
log.source = "//#{host}/#{log.source}"
Puppet::Uti... |
github | puppetlabs/puppet | https://github.com/puppetlabs/puppet | lib/puppet/external/dot.rb | Ruby | apache-2.0 | 7,843 | main | 9,286 | # frozen_string_literal: true
# rdot.rb
#
#
# This is a modified version of dot.rb from Dave Thomas's rdoc project. I [Horst Duchene]
# renamed it to rdot.rb to avoid collision with an installed rdoc/dot.
#
# It also supports undirected edges.
module DOT
# These global vars are used to make nice graph source.
$... |
github | puppetlabs/puppet | https://github.com/puppetlabs/puppet | lib/puppet/forge/cache.rb | Ruby | apache-2.0 | 7,843 | main | 1,734 | # frozen_string_literal: true
require 'uri'
require_relative '../../puppet/forge'
class Puppet::Forge
# = Cache
#
# Provides methods for reading files from local cache, filesystem or network.
class Cache
# Instantiate new cache for the +repository+ instance.
def initialize(repository, options = {})
... |
github | puppetlabs/puppet | https://github.com/puppetlabs/puppet | lib/puppet/forge/repository.rb | Ruby | apache-2.0 | 7,843 | main | 2,792 | # frozen_string_literal: true
require_relative '../../puppet/ssl/openssl_loader'
require 'digest/sha1'
require 'uri'
require_relative '../../puppet/forge'
require_relative '../../puppet/forge/errors'
require_relative '../../puppet/network/http'
class Puppet::Forge
# = Repository
#
# This class is a file for acc... |
github | puppetlabs/puppet | https://github.com/puppetlabs/puppet | lib/puppet/forge/errors.rb | Ruby | apache-2.0 | 7,843 | main | 4,297 | # frozen_string_literal: true
require_relative '../../puppet/util/json'
require_relative '../../puppet/error'
require_relative '../../puppet/forge'
# Puppet::Forge specific exceptions
module Puppet::Forge::Errors
# This exception is the parent for all Forge API errors
class ForgeError < Puppet::Error
# This i... |
github | puppetlabs/puppet | https://github.com/puppetlabs/puppet | lib/puppet/x509/pem_store.rb | Ruby | apache-2.0 | 7,843 | main | 1,802 | # frozen_string_literal: true
require_relative '../../puppet/x509'
# Methods for managing PEM encoded files. While PEM encoded strings are
# always ASCII, the files may contain user specified comments, so they are
# UTF-8 encoded.
#
# @api private
module Puppet::X509::PemStore
# Load a pem encoded object.
#
# @... |
github | puppetlabs/puppet | https://github.com/puppetlabs/puppet | lib/puppet/x509/cert_provider.rb | Ruby | apache-2.0 | 7,843 | main | 14,100 | # frozen_string_literal: true
require_relative '../../puppet/x509'
# Class for loading and saving cert related objects. By default the provider
# loads and saves based on puppet's default settings, such as `Puppet[:localcacert]`.
# The providers sets the permissions on files it saves, such as the private key.
# All o... |
github | puppetlabs/puppet | https://github.com/puppetlabs/puppet | lib/puppet/util/reference.rb | Ruby | apache-2.0 | 7,843 | main | 1,927 | # frozen_string_literal: true
require_relative '../../puppet/util/instance_loader'
require 'fileutils'
# Manage Reference Documentation.
class Puppet::Util::Reference
include Puppet::Util
include Puppet::Util::Docs
extend Puppet::Util::InstanceLoader
instance_load(:reference, 'puppet/reference')
def self... |
github | puppetlabs/puppet | https://github.com/puppetlabs/puppet | lib/puppet/util/rdoc.rb | Ruby | apache-2.0 | 7,843 | main | 1,472 | # frozen_string_literal: true
require_relative '../../puppet/util'
module Puppet::Util::RDoc
module_function
# launch a rdoc documentation process
# with the files/dir passed in +files+
def rdoc(outputdir, files, charset = nil)
# then rdoc
require 'rdoc/rdoc'
require 'rdoc/options'
# load our... |
github | puppetlabs/puppet | https://github.com/puppetlabs/puppet | lib/puppet/util/command_line.rb | Ruby | apache-2.0 | 7,843 | main | 6,777 | # frozen_string_literal: true
# Bundler and rubygems maintain a set of directories from which to
# load gems. If Bundler is loaded, let it determine what can be
# loaded. If it's not loaded, then use rubygems. But do this before
# loading any puppet code, so that our gem loading system is sane.
unless defined? ::Bundl... |
github | puppetlabs/puppet | https://github.com/puppetlabs/puppet | lib/puppet/util/run_mode.rb | Ruby | apache-2.0 | 7,843 | main | 3,909 | # frozen_string_literal: true
require 'etc'
module Puppet
module Util
class RunMode
def initialize(name)
@name = name.to_sym
end
attr_reader :name
def self.[](name)
@run_modes ||= {}
if Puppet::Util::Platform.windows?
@run_modes[name] ||= WindowsRunMod... |
github | puppetlabs/puppet | https://github.com/puppetlabs/puppet | lib/puppet/util/windows.rb | Ruby | apache-2.0 | 7,843 | main | 1,769 | # frozen_string_literal: true
require_relative '../../puppet/util/platform'
module Puppet::Util::Windows
module ADSI
class ADSIObject; end
class User < ADSIObject; end
class UserProfile; end
class Group < ADSIObject; end
end
module File; end
module Registry
end
module Service
DEFAUL... |
github | puppetlabs/puppet | https://github.com/puppetlabs/puppet | lib/puppet/util/backups.rb | Ruby | apache-2.0 | 7,843 | main | 2,562 | # frozen_string_literal: true
require 'find'
require 'fileutils'
module Puppet::Util::Backups
# Deal with backups.
def perform_backup(file = nil)
# if they specifically don't want a backup, then just say
# we're good
return true unless self[:backup]
# let the path be specified
file ||= self[:p... |
github | puppetlabs/puppet | https://github.com/puppetlabs/puppet | lib/puppet/util/package.rb | Ruby | apache-2.0 | 7,843 | main | 989 | # frozen_string_literal: true
module Puppet::Util::Package
def versioncmp(version_a, version_b, ignore_trailing_zeroes = false)
vre = /[-.]|\d+|[^-.\d]+/
if ignore_trailing_zeroes
version_a = normalize(version_a)
version_b = normalize(version_b)
end
ax = version_a.scan(vre)
bx = ver... |
github | puppetlabs/puppet | https://github.com/puppetlabs/puppet | lib/puppet/util/warnings.rb | Ruby | apache-2.0 | 7,843 | main | 753 | # frozen_string_literal: true
# Methods to help with handling warnings.
module Puppet::Util::Warnings
module_function
def notice_once(msg)
Puppet::Util::Warnings.maybe_log(msg, self.class) { Puppet.notice msg }
end
def debug_once(msg)
return nil unless Puppet[:debug]
Puppet::Util::Warnings.maybe... |
github | puppetlabs/puppet | https://github.com/puppetlabs/puppet | lib/puppet/util/profiler.rb | Ruby | apache-2.0 | 7,843 | main | 1,538 | # frozen_string_literal: true
require 'benchmark'
# A simple profiling callback system.
#
# @api public
module Puppet::Util::Profiler
require_relative 'profiler/wall_clock'
require_relative 'profiler/object_counts'
require_relative 'profiler/around_profiler'
@profiler = Puppet::Util::Profiler::AroundProfiler... |
github | puppetlabs/puppet | https://github.com/puppetlabs/puppet | lib/puppet/util/lockfile.rb | Ruby | apache-2.0 | 7,843 | main | 2,021 | # frozen_string_literal: true
# This class provides a simple API for managing a lock file
# whose contents are an (optional) String. In addition
# to querying the basic state (#locked?) of the lock, managing
# the lock (#lock, #unlock), the contents can be retrieved at
# any time while the lock is held (#lock_data). ... |
github | puppetlabs/puppet | https://github.com/puppetlabs/puppet | lib/puppet/util/docs.rb | Ruby | apache-2.0 | 7,843 | main | 4,090 | # frozen_string_literal: true
# Some simple methods for helping manage automatic documentation generation.
module Puppet::Util::Docs
# Specify the actual doc string.
def desc(str)
@doc = str
end
# Add a new autodoc block. We have to define these as class methods,
# rather than just sticking them in a h... |
github | puppetlabs/puppet | https://github.com/puppetlabs/puppet | lib/puppet/util/json_lockfile.rb | Ruby | apache-2.0 | 7,843 | main | 1,958 | # frozen_string_literal: true
require_relative '../../puppet/util/lockfile'
# This class provides a simple API for managing a lock file
# whose contents are a serialized JSON object. In addition
# to querying the basic state (#locked?) of the lock, managing
# the lock (#lock, #unlock), the contents can be retrieved ... |
github | puppetlabs/puppet | https://github.com/puppetlabs/puppet | lib/puppet/util/logging.rb | Ruby | apache-2.0 | 7,843 | main | 11,737 | # frozen_string_literal: true
# A module to make logging a bit easier.
require_relative '../../puppet/util/log'
require_relative '../../puppet/error'
module Puppet::Util
module Logging
def send_log(level, message)
Puppet::Util::Log.create({ :level => level, :source => log_source, :message => message }.merge(log... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.