Module: Chef::Knife::KeyEditBase

Included in:
ClientKeyEdit, UserKeyEdit
Defined in:
lib/chef/knife/key_edit_base.rb

Overview

Extendable module that class_eval’s common options into UserKeyEdit and ClientKeyEdit

Author:

  • Tyler Cloke

Class Method Summary collapse

Class Method Details

.included(includer) ⇒ Object



25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# File 'lib/chef/knife/key_edit_base.rb', line 25

def self.included(includer)
  includer.class_eval do
    option :public_key,
      short: "-p FILENAME",
      long: "--public-key FILENAME",
      description: "Replace the public_key field from a file on disk. If not passed, the public_key field will not change."

    option :create_key,
      short: "-c",
      long: "--create-key",
      description: "Replace the public_key field with a key generated by the server. The private key will be returned."

    option :file,
      short: "-f FILE",
      long: "--file FILE",
      description: "Write the private key to a file, if you requested the server to create one via --create-key."

    option :key_name,
      short: "-k NAME",
      long: "--key-name NAME",
      description: "The new name for your key. Pass if you wish to update the name field of your key."

    option :expiration_date,
      short: "-e DATE",
      long: "--expiration-date DATE",
      description: "Updates the expiration_date field of your key if passed. Pass in ISO 8601 fomatted string: YYYY-MM-DDTHH:MM:SSZ e.g. 2013-12-24T21:00:00Z or infinity. UTC timezone assumed."
  end
end