Sha256: fe9a703adb803fd3b54e957d22ce3a6f3e2259848640c8b1b15509ed83b2063c

Contents?: true

Size: 746 Bytes

Versions: 2

Compression:

Stored size: 746 Bytes

Contents

require 'chef_metal_fog/fog_driver'
require 'chef/resource/fog_key_pair'
require 'chef/provider/fog_key_pair'

class Chef
  module DSL
    module Recipe
      def with_fog_driver(provider, driver_options = nil, &block)
        config = Cheffish::MergedConfig.new({ :driver_options => driver_options }, run_context.config)
        driver = ChefMetalFog::FogDriver.from_provider(provider, config)
        run_context.chef_metal.with_driver(driver, &block)
      end

      def with_fog_ec2_driver(driver_options = nil, &block)
        with_fog_driver('AWS', driver_options, &block)
      end

      def with_fog_openstack_driver(driver_options = nil, &block)
        with_fog_driver('OpenStack', driver_options, &block)
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
chef-metal-fog-0.5.beta.2 lib/chef_metal_fog/recipe_dsl.rb
chef-metal-fog-0.5.beta lib/chef_metal_fog/recipe_dsl.rb