Skip to content

Instantly share code, notes, and snippets.

@tyler-ball
Created September 9, 2014 17:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tyler-ball/44a8cfdb152281b3e143 to your computer and use it in GitHub Desktop.
Save tyler-ball/44a8cfdb152281b3e143 to your computer and use it in GitHub Desktop.
class Chef
class Knife
module DataBagSecretOptions
include Mixlib::CLI
option :secret,
:short => "-s SECRET",
:long => "--secret ",
:description => "The secret key to use to encrypt data bag item values",
:proc => Proc.new { |s| Chef::Config[:knife][:secret] = s }
option :secret_file,
:long => "--secret-file SECRET_FILE",
:description => "A file containing the secret key to use to encrypt data bag item values",
:proc => Proc.new { |sf| Chef::Config[:knife][:secret_file] = sf }
option :encrypt,
:long => "--encrypt",
:description => "Only use the secret configured in knife.rb when this is true",
:boolean => true,
:default => false
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment