Class: Chef::Provider::RemoteRecipe
- Inherits:
-
Chef::Provider
- Object
- Chef::Provider
- Chef::Provider::RemoteRecipe
- Defined in:
- lib/chef/providers/remote_recipe_provider.rb
Overview
RemoteRecipe chef provider.
Instance Method Summary collapse
-
#action_run ⇒ Object
Actually run RemoteRecipe.
-
#load_current_resource ⇒ Object
No concept of a ‘current’ resource for RemoteRecipe execution, this is a no-op.
Instance Method Details
#action_run ⇒ Object
Actually run RemoteRecipe
Return
- true
-
Always return true
42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 |
# File 'lib/chef/providers/remote_recipe_provider.rb', line 42 def action_run = @new_resource. recipients = @new_resource.recipients = RightScale::OptionsBag.load attributes = { :remote_recipe => { :tags => , :from => [:identity] } } attributes.merge!(@new_resource.attributes) if @new_resource.attributes payload = { :recipe => @new_resource.recipe, :json => attributes.to_json } if recipients && !recipients.empty? target = if (s = recipients.size) == 1 'one remote instance' else "#{s} remote instances" end Chef::Log.info("Scheduling execution of #{@new_resource.recipe.inspect} on #{target}") recipients.each do |recipient| RightScale::Cook.instance.send_push('/instance_scheduler/execute', payload, recipient) end end if && !.empty? selector = (@new_resource.scope == :single ? :any : :all) target_tag = if .size == 1 "tag #{.first.inspect}" else "tags #{.map { |t| t.inspect }.join(', ') }" end target = if selector == :all "all instances with #{target_tag}" else "one instance with #{target_tag}" end Chef::Log.info("Scheduling execution of #{@new_resource.recipe.inspect} on #{target}") RightScale::Cook.instance.send_push('/instance_scheduler/execute', payload, {:tags => , :selector => selector}) end true end |
#load_current_resource ⇒ Object
No concept of a ‘current’ resource for RemoteRecipe execution, this is a no-op
Return
- true
-
Always return true
34 35 36 |
# File 'lib/chef/providers/remote_recipe_provider.rb', line 34 def load_current_resource true end |