Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Fix for Issue #6 #7

Merged
merged 1 commit into from

2 participants

@ajardan

...in it to avoid conflicts when configuring 2 different chef servers with the same client name.

Andrian Jardan #6 Fixed client key name and path generation so it includes config na…
…me in it to avoid conflicts when configuring 2 different chef servers with the same client name.
d2852f8
@proffalken proffalken merged commit 87e2b2d into knife-block:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Mar 13, 2013
  1. #6 Fixed client key name and path generation so it includes config na…

    Andrian Jardan authored
    …me in it to avoid conflicts when configuring 2 different chef servers with the same client name.
This page is out of date. Refresh to see the latest.
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
Something went wrong with that request. Please try again.