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, config) ⇒ Plugin

Returns a new instance of Plugin


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

def initialize(lookup, config)
  @lookup = lookup
  @config = config
end

Instance Attribute Details

#configObject (readonly)

Returns the value of attribute config


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

def config
  @config
end

#lookupObject (readonly)

Returns the value of attribute lookup


2
3
4
# File 'lib/jerakia/lookup/plugin.rb', line 2

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


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

def request
  lookup.request
end

#scopeObject


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

def scope
  lookup.scope
end