Sha256: a1098755b1e7488a29e30898234f0aea230d46ad9741401e2f166395ff5df97c

Contents?: true

Size: 1.14 KB

Versions: 24

Compression:

Stored size: 1.14 KB

Contents

require 'chef/provisioning'

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

  def initialize(*args)
    super
    @driver = run_context.chef_provisioning.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

  # We are not interested in Chef's cloning behavior here.
  def load_prior_resource(*args)
    Chef::Log.debug("Overloading #{resource_name}.load_prior_resource with NOOP")
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
chef-provisioning-fog-0.26.1 lib/chef/resource/fog_key_pair.rb
chef-provisioning-fog-0.26.0 lib/chef/resource/fog_key_pair.rb
chef-provisioning-fog-0.25.1 lib/chef/resource/fog_key_pair.rb
chef-provisioning-fog-0.25.0 lib/chef/resource/fog_key_pair.rb
chef-provisioning-fog-0.24.1 lib/chef/resource/fog_key_pair.rb
chef-provisioning-fog-0.24.0 lib/chef/resource/fog_key_pair.rb
chef-provisioning-fog-0.23.0 lib/chef/resource/fog_key_pair.rb
chef-provisioning-fog-0.22.0 lib/chef/resource/fog_key_pair.rb
chef-provisioning-fog-0.21.0 lib/chef/resource/fog_key_pair.rb
chef-provisioning-fog-0.20.0 lib/chef/resource/fog_key_pair.rb
chef-provisioning-fog-0.19.1 lib/chef/resource/fog_key_pair.rb
chef-provisioning-fog-0.19.0 lib/chef/resource/fog_key_pair.rb
chef-provisioning-fog-0.18.0 lib/chef/resource/fog_key_pair.rb
chef-provisioning-fog-0.17.0 lib/chef/resource/fog_key_pair.rb
chef-provisioning-fog-0.16.0 lib/chef/resource/fog_key_pair.rb
chef-provisioning-fog-0.15.3 lib/chef/resource/fog_key_pair.rb
chef-provisioning-fog-0.15.2 lib/chef/resource/fog_key_pair.rb
chef-provisioning-fog-0.15.1 lib/chef/resource/fog_key_pair.rb
chef-provisioning-fog-0.14.0 lib/chef/resource/fog_key_pair.rb
chef-provisioning-fog-0.13.2 lib/chef/resource/fog_key_pair.rb