Class: CemAcpt::Bolt::Inventory

Inherits:
YamlFile
  • Object
show all
Defined in:
lib/cem_acpt/bolt/inventory.rb

Overview

Provides an abstraction for the Bolt inventory file

Constant Summary

Constants included from Logging

Logging::LEVEL_MAP

Instance Attribute Summary collapse

Attributes inherited from YamlFile

#path

Instance Method Summary collapse

Methods inherited from YamlFile

#delete!, #eq_to_disk?, #gte_to_disk?, #latest_saved?, #load!, #lte_to_disk?, #save!, #to_h

Methods included from Logging

current_log_config, #current_log_config, current_log_format, #current_log_format, #current_log_level, current_log_level, included, #logger, logger, new_log_config, #new_log_config, new_log_formatter, #new_log_formatter, #new_log_level, new_log_level, #new_logger, new_logger, verbose?, #verbose?

Constructor Details

#initialize(config, hosts = [], private_key = nil) ⇒ Inventory

Returns a new instance of Inventory.



12
13
14
15
16
17
18
19
# File 'lib/cem_acpt/bolt/inventory.rb', line 12

def initialize(config, hosts = [], private_key = nil)
  path = config.get('bolt.inventory_path') || 'inventory.yaml'
  super(path)
  @config = config
  @hosts = hosts
  @private_key = private_key
  @hash = new_inventory_hash(hosts, private_key, config)
end

Instance Attribute Details

#configObject (readonly)

Returns the value of attribute config.



10
11
12
# File 'lib/cem_acpt/bolt/inventory.rb', line 10

def config
  @config
end

#hostsObject

Returns the value of attribute hosts.



10
11
12
# File 'lib/cem_acpt/bolt/inventory.rb', line 10

def hosts
  @hosts
end

#private_keyObject

Returns the value of attribute private_key.



10
11
12
# File 'lib/cem_acpt/bolt/inventory.rb', line 10

def private_key
  @private_key
end