Class Puppet::Resource::Catalog
In: lib/puppet/resource/catalog.rb
Parent: Puppet::SimpleGraph

This class models a node catalog. It is the thing meant to be passed from server to client, and it contains all of the information in the catalog, including the resources and the relationships between them.

Methods

Included Modules

Puppet::Util::Tagging Puppet::Util::Cacher::Expirer

Classes and Modules

Class Puppet::Resource::Catalog::DuplicateResourceError

Attributes

client_version  [RW]  Some metadata to help us compile and generally respond to the current state.
extraction_format  [R]  How we should extract the catalog for sending to the client.
from_cache  [RW]  Whether this catalog was retrieved from the cache, which affects whether it is written back out again.
host_config  [RW]  Whether this is a host catalog, which behaves very differently. In particular, reports are sent, graphs are made, and state is stored in the state database. If this is set incorrectly, then you often end up in infinite loops, because catalogs are used to make things that the host catalog needs.
name  [RW]  The host name this is a catalog for.
retrieval_duration  [RW]  How long this catalog took to retrieve. Used for reporting stats.
server_version  [RW]  Some metadata to help us compile and generally respond to the current state.
version  [RW]  The catalog version. Used for testing whether a catalog is up to date.

Public Class methods

Public Instance methods

Add classes to our class list.

Add one or more resources to our graph and to our resource table. This is actually a relatively complicated method, because it handles multiple aspects of Catalog behaviour:

Apply our catalog to the local host. Valid options are:

  :tags - set the tags that restrict what resources run
      during the transaction
  :ignoreschedules - tell the transaction to ignore schedules
      when determining the resources to run

Are we in the middle of applying the catalog?

Create a new resource and register it in the catalog.

Turn our catalog graph into whatever the client is expecting.

Create the traditional TransBuckets and TransObjects from our catalog graph. LAK:NOTE(20081211): This is a pre-0.25 backward compatibility method. It can be removed as soon as xmlrpc is killed.

Make sure we support the requested extraction format.

filter out the catalog, applying block to each resource. If the block result is false, the resource will be kept otherwise it will be skipped

Make sure all of our resources are "finished".

Make the default objects necessary for function.

Create a graph of all of the relationships in our catalog.

Remove the resource from our catalog. Notice that we also call ‘remove’ on the resource, at least until resource classes no longer maintain references to the resource instances.

Look a resource up by its reference (e.g., File[/etc/passwd]).

Return an array of all resources.

Convert our catalog into a RAL catalog.

Convert our catalog into a catalog of Puppet::Resource instances.

Store the classes in the classfile.

Produce the graph files if requested.

[Validate]