Class: Chef::Provider::MachineBatch

Inherits:
LWRPBase
  • Object
show all
Includes:
ChefMetal::ProviderActionHandler
Defined in:
lib/chef/provider/machine_batch.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from ChefMetal::ProviderActionHandler

#debug_name, #perform_action, #recipe_context, #updated!

Instance Attribute Details

#node_providersObject (readonly)

Returns the value of attribute node_providers.



36
37
38
# File 'lib/chef/provider/machine_batch.rb', line 36

def node_providers
  @node_providers
end

Instance Method Details

#load_current_resourceObject



38
39
40
41
42
43
44
45
46
47
# File 'lib/chef/provider/machine_batch.rb', line 38

def load_current_resource
  @node_providers = {}
  new_resource.machines.each do |machine|
    @node_providers[machine] = Chef::Provider.ChefNode.new(machine, nil)
  end
  # Load nodes in parallel
  Chef::ChefFS::Parallelizer.parallelize(@node_providers.values) do |node_provider|
    node_provider.load_current_resource
  end
end

#whyrun_supported?Boolean

Returns:

  • (Boolean)


11
12
13
# File 'lib/chef/provider/machine_batch.rb', line 11

def whyrun_supported?
  true
end