Class: Bolt::ApplyInventory

Inherits:
Object
  • Object
show all
Defined in:
lib/bolt/apply_inventory.rb

Defined Under Namespace

Classes: InvalidFunctionCall

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(config_hash = {}) ⇒ ApplyInventory

Returns a new instance of ApplyInventory.


18
19
20
21
# File 'lib/bolt/apply_inventory.rb', line 18

def initialize(config_hash = {})
  @config_hash = config_hash
  @targets = {}
end

Instance Attribute Details

#config_hashObject (readonly)

Returns the value of attribute config_hash.


16
17
18
# File 'lib/bolt/apply_inventory.rb', line 16

def config_hash
  @config_hash
end

Instance Method Details

#add_facts(*_params) ⇒ Object


61
62
63
# File 'lib/bolt/apply_inventory.rb', line 61

def add_facts(*_params)
  raise InvalidFunctionCall, 'add_facts'
end

#add_to_group(*_params) ⇒ Object


77
78
79
# File 'lib/bolt/apply_inventory.rb', line 77

def add_to_group(*_params)
  raise InvalidFunctionCall, 'add_to_group'
end

#create_apply_target(target) ⇒ Object


23
24
25
# File 'lib/bolt/apply_inventory.rb', line 23

def create_apply_target(target)
  @targets[target.name] = target
end

#facts(target) ⇒ Object


65
66
67
# File 'lib/bolt/apply_inventory.rb', line 65

def facts(target)
  @targets[target.name].facts
end

#features(target) ⇒ Object


69
70
71
# File 'lib/bolt/apply_inventory.rb', line 69

def features(target)
  @targets[target.name].features
end

#get_target(*_params) ⇒ Object


43
44
45
# File 'lib/bolt/apply_inventory.rb', line 43

def get_target(*_params)
  raise InvalidFunctionCall, 'get_target'
end

#get_targets(*_params) ⇒ Object


39
40
41
# File 'lib/bolt/apply_inventory.rb', line 39

def get_targets(*_params)
  raise InvalidFunctionCall, 'get_targets'
end

#plugin_hooks(target) ⇒ Object


81
82
83
# File 'lib/bolt/apply_inventory.rb', line 81

def plugin_hooks(target)
  @targets[target.name].plugin_hooks
end

#resource(target, type, title) ⇒ Object


73
74
75
# File 'lib/bolt/apply_inventory.rb', line 73

def resource(target, type, title)
  @targets[target.name].resource(type, title)
end

#set_config(_target, _key_or_key_path, _value) ⇒ Object


85
86
87
# File 'lib/bolt/apply_inventory.rb', line 85

def set_config(_target, _key_or_key_path, _value)
  raise InvalidFunctionCall, 'set_config'
end

#set_feature(*_params) ⇒ Object


52
53
54
# File 'lib/bolt/apply_inventory.rb', line 52

def set_feature(*_params)
  raise InvalidFunctionCall, 'set_feature'
end

#set_var(*_params) ⇒ Object

rubocop:disable Naming/AccessorMethodName


48
49
50
# File 'lib/bolt/apply_inventory.rb', line 48

def set_var(*_params)
  raise InvalidFunctionCall, 'set_var'
end

#target_config(target) ⇒ Object


89
90
91
# File 'lib/bolt/apply_inventory.rb', line 89

def target_config(target)
  @targets[target.name].config
end

#target_implementation_classObject


35
36
37
# File 'lib/bolt/apply_inventory.rb', line 35

def target_implementation_class
  Bolt::ApplyTarget
end

#validateObject


27
28
29
# File 'lib/bolt/apply_inventory.rb', line 27

def validate
  @groups.validate
end

#vars(target) ⇒ Object

rubocop:enable Naming/AccessorMethodName


57
58
59
# File 'lib/bolt/apply_inventory.rb', line 57

def vars(target)
  @targets[target.name].vars
end

#versionObject


31
32
33
# File 'lib/bolt/apply_inventory.rb', line 31

def version
  2
end