Sha256: bc70d3bc6597a68f560e7c9ffe6b2f005ec0faba46afe7eb375d8534be5b4b7a

Contents?: true

Size: 837 Bytes

Versions: 2

Compression:

Stored size: 837 Bytes

Contents

require "opsicle/deploy_helper"

module Opsicle
  class ExecuteRecipes
    include DeployHelper
    attr_reader :client, :recipes

    def initialize(environment)
      @environment = environment
      @client = Client.new(environment)
    end

    def execute(options={ monitor: true })
      Output.say "Starting OpsWorks chef run..."

      #so this is how to format the command arguments:
      #http://docs.aws.amazon.com/AWSRubySDK/latest/AWS/OpsWorks/Client.html#create_deployment-instance_method
      command_args = {}
      command_args["recipes"] = options[:recipes]

      command_opts = {}
      command_opts["instance_ids"] = options[:instance_ids] if options[:instance_ids]

      response = client.run_command('execute_recipes', command_args, command_opts)
      launch_stack_monitor(response, options)
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
opsicle-0.5.1 lib/opsicle/commands/execute_recipes.rb
opsicle-0.5.0 lib/opsicle/commands/execute_recipes.rb