Class: Jerakia::Lookup::Plugin

Inherits:
Object
  • Object
show all
Defined in:
lib/jerakia/lookup/plugin/hiera.rb,
lib/jerakia/lookup/plugin.rb

Overview

This plugin reformats the lookup key according to a puppet’s Hiera system, so instead of looking up <key> in <path>/<namespace>.yaml we lookup <namespace>::<key> in <path>.yaml

This is a useful plugin for people wanting to test drive Jerakia but maintain an existing hiera filesystem layout and naming convention within the source data.

Defined Under Namespace

Modules: Hiera

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(lookup) ⇒ Plugin

Returns a new instance of Plugin.



6
7
8
# File 'lib/jerakia/lookup/plugin.rb', line 6

def initialize(lookup)
  @lookup = lookup
end

Instance Attribute Details

#lookupObject (readonly)

Returns the value of attribute lookup.



4
5
6
# File 'lib/jerakia/lookup/plugin.rb', line 4

def lookup
  @lookup
end

Instance Method Details

#activate(name) ⇒ Object



10
11
12
# File 'lib/jerakia/lookup/plugin.rb', line 10

def activate(name)
  instance_eval "extend Jerakia::Lookup::Plugin::#{name.to_s.capitalize}"
end

#requestObject



18
19
20
# File 'lib/jerakia/lookup/plugin.rb', line 18

def request
  lookup.request
end

#scopeObject



14
15
16
# File 'lib/jerakia/lookup/plugin.rb', line 14

def scope
  lookup.scope
end