Class: CemAcpt::Bolt::Inventory
- Defined in:
- lib/cem_acpt/bolt/inventory.rb
Overview
Provides an abstraction for the Bolt inventory file
Constant Summary
Constants included from Logging
Instance Attribute Summary collapse
-
#config ⇒ Object
readonly
Returns the value of attribute config.
-
#hosts ⇒ Object
Returns the value of attribute hosts.
-
#private_key ⇒ Object
Returns the value of attribute private_key.
Attributes inherited from YamlFile
Instance Method Summary collapse
-
#initialize(config, hosts = [], private_key = nil) ⇒ Inventory
constructor
A new instance of Inventory.
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
#config ⇒ Object (readonly)
Returns the value of attribute config.
10 11 12 |
# File 'lib/cem_acpt/bolt/inventory.rb', line 10 def config @config end |
#hosts ⇒ Object
Returns the value of attribute hosts.
10 11 12 |
# File 'lib/cem_acpt/bolt/inventory.rb', line 10 def hosts @hosts end |
#private_key ⇒ Object
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 |