Skip to content
Browse files

Merge pull request #7 from ajardan/master

Fix for Issue #6 - looks good to me
  • Loading branch information...
2 parents f0da6e9 + d2852f8 commit 87e2b2d19fe2057b7762fa7c605ed269905dd32c @proffalken proffalken committed
Showing with 3 additions and 0 deletions.
  1. +3 −0 lib/chef/knife/block.rb
View
3 lib/chef/knife/block.rb
@@ -113,12 +113,15 @@ def run
end
@chef_server = ui.ask_question("Please enter the url to your Chef Server: ")
+ @client_name = ui.ask_question("Please enter the name of the Chef client: ")
require 'ohai'
require 'chef/knife/configure'
GreenAndSecure::check_block_setup
knife_config = Chef::Knife::Configure.new
knife_config.config[:config_file] = "#{::Chef::Knife::chef_config_dir}/knife-#{@config_name}.rb"
knife_config.config[:chef_server_url] = @chef_server
+ knife_config.config[:node_name] = @client_name
+ knife_config.config[:client_key] = "#{::Chef::Knife::chef_config_dir}/#{@client_name}-#{@config_name}.pem"
knife_config.run
puts "#{::Chef::Knife::chef_config_dir}/knife-#{@config_name}.rb has been sucessfully created"
GreenAndSecure::BlockList.new.run

0 comments on commit 87e2b2d

Please sign in to comment.
Something went wrong with that request. Please try again.