Sha256: 8bc5b83d005f89aa6d7208d846fefcaa7aee2d03ccc029cc7cb3aa29007da65d
Contents?: true
Size: 799 Bytes
Versions: 30
Compression:
Stored size: 799 Bytes
Contents
require 'puppet/indirector/terminus' class Puppet::Indirector::Hiera < Puppet::Indirector::Terminus def initialize(*args) if ! Puppet.features.hiera? raise "Hiera terminus not supported without hiera library" end super end def find(request) hiera.lookup(request.key, nil, request.options[:variables], nil, nil) end private def self.hiera_config hiera_config = Puppet.settings[:hiera_config] config = {} if File.exist?(hiera_config) config = Hiera::Config.load(hiera_config) else Puppet.warning "Config file #{hiera_config} not found, using Hiera defaults" end config[:logger] = 'puppet' config end def self.hiera @hiera ||= Hiera.new(:config => hiera_config) end def hiera self.class.hiera end end
Version data entries
30 entries across 30 versions & 2 rubygems