class HieraLoader

Attributes

hiera[RW]
scope[RW]

Public Class Methods

new(scope, config = 'hiera.yaml') click to toggle source
# File lib/hiera_loader.rb, line 21
def initialize(scope, config = 'hiera.yaml')
    @hiera = Hiera.new(:config => config)
    @scope = scope
end

Public Instance Methods

get_config(key, is_required=true) click to toggle source
# File lib/hiera_loader.rb, line 26
def get_config(key, is_required=true)
    val = @hiera.lookup(key, nil, @scope)
    if is_required == true and !val
        puts "Required config #{key} not found. Please provide."
        raise "Required config #{key} not found. Please provide."
    end
    val
end