Sha256: 78f145c29a431e8a7eafe2c32ed18b5271045706c3ccfc349b21c5ef374be0d1

Contents?: true

Size: 891 Bytes

Versions: 15

Compression:

Stored size: 891 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

      def with_fog_rackspace_driver(driver_options = nil, &block)
        with_fog_driver('Rackspace', driver_options, &block)
      end
      
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
chef-metal-fog-0.9 lib/chef_metal_fog/recipe_dsl.rb
chef-metal-fog-0.8 lib/chef_metal_fog/recipe_dsl.rb
chef-metal-fog-0.7.1 lib/chef_metal_fog/recipe_dsl.rb
chef-metal-fog-0.7 lib/chef_metal_fog/recipe_dsl.rb
chef-metal-fog-0.6.1 lib/chef_metal_fog/recipe_dsl.rb
chef-metal-fog-0.6 lib/chef_metal_fog/recipe_dsl.rb
chef-metal-fog-0.5.4 lib/chef_metal_fog/recipe_dsl.rb
chef-metal-fog-0.5.3 lib/chef_metal_fog/recipe_dsl.rb
chef-metal-fog-0.5.2 lib/chef_metal_fog/recipe_dsl.rb
chef-metal-fog-0.5.1 lib/chef_metal_fog/recipe_dsl.rb
chef-metal-fog-0.5 lib/chef_metal_fog/recipe_dsl.rb
chef-metal-fog-0.5.beta.6 lib/chef_metal_fog/recipe_dsl.rb
chef-metal-fog-0.5.beta.5 lib/chef_metal_fog/recipe_dsl.rb
chef-metal-fog-0.5.beta.4 lib/chef_metal_fog/recipe_dsl.rb
chef-metal-fog-0.5.beta.3 lib/chef_metal_fog/recipe_dsl.rb