Module: Jerakia::Lookup::Plugin

Defined in:
lib/jerakia/plugins/lookup/confine.rb,
lib/jerakia/plugins/lookup/hiera_compat.rb

Instance Method Summary collapse

Instance Method Details

#calling_module ⇒ Object



16
17
18
19
20
21
22
# File 'lib/jerakia/plugins/lookup/hiera_compat.rb', line 16

def calling_module
  if request.namespace.length > 0
    request.namespace[0]
  else
    Jerakia.log.error("hiera_compat plugin tried to use calling_module but there is no namespace declared.  Ensure that calling_module is called before hiera_compat in the policy")
  end
end

#confine(key = nil, match) ⇒ Object



4
5
6
7
8
9
10
# File 'lib/jerakia/plugins/lookup/confine.rb', line 4

def confine(key=nil,match)
  if key
    invalidate unless key[Regexp.new(match)] == key
  else
    invalidate
  end
end

#exclude(key = nil, match) ⇒ Object



12
13
14
15
16
# File 'lib/jerakia/plugins/lookup/confine.rb', line 12

def exclude(key=nil,match)
  if key
    invalidate if key[Regexp.new(match)] == key
  end
end

#hiera_compat ⇒ Object



11
12
13
14
# File 'lib/jerakia/plugins/lookup/hiera_compat.rb', line 11

def hiera_compat
  request.key.prepend("#{request.namespace.join('::')}::")
  request.namespace=[]
end