Class: Hiera::Backend::Connect_backend
- Inherits:
 - 
      Object
      
        
- Object
 - Hiera::Backend::Connect_backend
 
 
- Extended by:
 - Forwardable
 
- Defined in:
 - lib/hiera/backend/connect_backend.rb
 
Overview
The hiera backend uses the Connect language to express your data. You can use regular hiera functionality to lookup the data
rubocop:disable ClassAndModuleCamelCase
Instance Attribute Summary collapse
- 
  
    
      #parsed  ⇒ Object 
    
    
  
  
  
  
    
      readonly
    
    
  
  
  
  
  
  
    
Returns the value of attribute parsed.
 
Instance Method Summary collapse
- 
  
    
      #initialize  ⇒ Connect_backend 
    
    
  
  
  
    constructor
  
  
  
  
  
  
  
    
A new instance of Connect_backend.
 - 
  
    
      #lookup(key, scope, order_override, _resolution_type, context = nil)  ⇒ Any 
    
    
  
  
  
  
  
  
  
  
  
    
Lookup an key in the connect configuration.
 - 
  
    
      #lookup_objects(keys, type, scope, order_override, _resolution_type)  ⇒ Any 
    
    
  
  
  
  
  
  
  
  
  
    
Lookup specfied objects in the connect configuration.
 - 
  
    
      #lookup_values(keys, scope, order_override, _resolution_type)  ⇒ Any 
    
    
  
  
  
  
  
  
  
  
  
    
Lookup specified values in the connect configuration.
 
Constructor Details
#initialize ⇒ Connect_backend
Returns a new instance of Connect_backend.
      25 26 27 28 29 30 31 32 33  | 
    
      # File 'lib/hiera/backend/connect_backend.rb', line 25 def initialize fail 'Connect section not filled in hiera.yaml' if Config[:connect].nil? Hiera.debug('CONNECT: Backend initialized') @configs_dir = Config[:connect].fetch(:datadir) { '/etc/puppet/config' } Hiera.debug("CONNECT: datadir is set to #{@configs_dir}") Connect.logger = Hiera.logger @connect = Connect::Dsl.instance(@configs_dir) @files = {} end  | 
  
Instance Attribute Details
#parsed ⇒ Object (readonly)
Returns the value of attribute parsed.
      23 24 25  | 
    
      # File 'lib/hiera/backend/connect_backend.rb', line 23 def parsed @parsed end  | 
  
Instance Method Details
#lookup(key, scope, order_override, _resolution_type, context = nil) ⇒ Any
Lookup an key in the connect configuration
      45 46 47 48 49 50  | 
    
      # File 'lib/hiera/backend/connect_backend.rb', line 45 def lookup(key, scope, order_override, _resolution_type, context = nil) setup_context(scope, order_override) value = @connect.lookup_value(key) Hiera.debug("CONNECT: looked up '#{key}' found '#{value}'") value end  | 
  
#lookup_objects(keys, type, scope, order_override, _resolution_type) ⇒ Any
Lookup specfied objects in the connect configuration
      79 80 81 82  | 
    
      # File 'lib/hiera/backend/connect_backend.rb', line 79 def lookup_objects(keys, type, scope, order_override, _resolution_type) setup_context(scope, order_override) @connect.lookup_objects(keys, type) end  | 
  
#lookup_values(keys, scope, order_override, _resolution_type) ⇒ Any
Lookup specified values in the connect configuration
      62 63 64 65  | 
    
      # File 'lib/hiera/backend/connect_backend.rb', line 62 def lookup_values(keys, scope, order_override, _resolution_type) setup_context(scope, order_override) @connect.lookup_values(keys) end  |