Sha256: e4d79b25f34a9a86c75408d183f5a44a5579475777648d18282102bfc37bfc6f

Contents?: true

Size: 970 Bytes

Versions: 16

Compression:

Stored size: 970 Bytes

Contents

require 'chef_metal'

class Chef::Resource::FogKeyPair < Chef::Resource::LWRPBase
  self.resource_name = 'fog_key_pair'

  def initialize(*args)
    super
    @driver = run_context.chef_metal.current_driver
  end

  actions :create, :delete, :nothing
  default_action :create

  attribute :driver
  # Private key to use as input (will be generated if it does not exist)
  attribute :private_key_path, :kind_of => String
  # Public key to use as input (will be generated if it does not exist)
  attribute :public_key_path, :kind_of => String
  # List of parameters to the private_key resource used for generation of the key
  attribute :private_key_options, :kind_of => Hash

  # TODO what is the right default for this?
  attribute :allow_overwrite, :kind_of => [TrueClass, FalseClass], :default => false

  # Proc that runs after the resource completes.  Called with (resource, private_key, public_key)
  def after(&block)
    block ? @after = block : @after
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

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