Sha256: dd07d5b02d51e0e693d8ceb0ae3f9b88c12099fe0e0ddd4d43c6030842e28676

Contents?: true

Size: 761 Bytes

Versions: 76

Compression:

Stored size: 761 Bytes

Contents

require 'puppet/node/facts'
require 'puppet/indirector/yaml'
require 'puppet/indirector/fact_search'

class Puppet::Node::Facts::Yaml < Puppet::Indirector::Yaml
  desc "Store client facts as flat files, serialized using YAML, or
    return deserialized facts from disk."

  include Puppet::Indirector::FactSearch

  def search(request)
    node_names = []
    Dir.glob(yaml_dir_path).each do |file|
      facts = load_file(file)
      if facts && node_matches?(facts, request.options)
        node_names << facts.name
      end
    end
    node_names
  end

  private

  # Return the path to a given node's file.
  def yaml_dir_path
    base = Puppet.run_mode.server? ? Puppet[:yamldir] : Puppet[:clientyamldir]
    File.join(base, 'facts', '*.yaml')
  end
end

Version data entries

76 entries across 76 versions & 1 rubygems

Version Path
puppet-7.3.0 lib/puppet/indirector/facts/yaml.rb
puppet-7.3.0-x86-mingw32 lib/puppet/indirector/facts/yaml.rb
puppet-7.3.0-x64-mingw32 lib/puppet/indirector/facts/yaml.rb
puppet-7.3.0-universal-darwin lib/puppet/indirector/facts/yaml.rb
puppet-6.20.0 lib/puppet/indirector/facts/yaml.rb
puppet-6.20.0-x86-mingw32 lib/puppet/indirector/facts/yaml.rb
puppet-6.20.0-x64-mingw32 lib/puppet/indirector/facts/yaml.rb
puppet-6.20.0-universal-darwin lib/puppet/indirector/facts/yaml.rb
puppet-7.1.0 lib/puppet/indirector/facts/yaml.rb
puppet-7.1.0-x86-mingw32 lib/puppet/indirector/facts/yaml.rb
puppet-7.1.0-x64-mingw32 lib/puppet/indirector/facts/yaml.rb
puppet-7.1.0-universal-darwin lib/puppet/indirector/facts/yaml.rb
puppet-7.0.0 lib/puppet/indirector/facts/yaml.rb
puppet-7.0.0-x86-mingw32 lib/puppet/indirector/facts/yaml.rb
puppet-7.0.0-x64-mingw32 lib/puppet/indirector/facts/yaml.rb
puppet-7.0.0-universal-darwin lib/puppet/indirector/facts/yaml.rb