class Puppet::Node::Facts::PuppetdbApply

This class provides an alternative implementation of the Facts::Puppetdb terminus that better suits execution via `puppet apply`.

This terminus is designed to be used as a cache terminus, to ensure that facts are stored in PuppetDB. It does not act as a real cache itself however, it tells Puppet to fallback to the `terminus` instead.

Attributes

dbstored[W]

Public Instance Methods

find(args) click to toggle source

By returning nil, we force puppet to use the real terminus.

# File lib/puppet/indirector/facts/puppetdb_apply.rb, line 22
def find(args)
  nil
end
save(args) click to toggle source

Here we override the normal save, only saving the first time, as a `save` can be called multiple times in a puppet run.

Calls superclass method Puppet::Node::Facts::Puppetdb#save
# File lib/puppet/indirector/facts/puppetdb_apply.rb, line 14
def save(args)
  unless @dbstored
    @dbstored = true
    super(args)
  end
end