summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJerry Aldrich III <jerry@chef.io>2016-12-01 01:35:19 -0500
committerJerry Aldrich III <jerry@chef.io>2016-12-01 09:02:34 -0500
commite0c2ccbb1132146b7a96019095483ee08f9e26ce (patch)
tree02a42fd80666d3a3e112f793b3b671a3fcc2be49
parent0a2e27001c3c678f2a0a7d354a14a4e36c6555e9 (diff)
downloadchef-e0c2ccbb1132146b7a96019095483ee08f9e26ce.tar.gz
Modify `knife configure` example `chef_server_url`
A working `knife.rb` needs `chef_server_url` to contain `organizations` in it's url. Signed-off-by: Jerry Aldrich III <jerry@chef.io>
-rw-r--r--distro/common/markdown/man1/knife-configure.mkd5
-rw-r--r--lib/chef/knife/configure.rb2
-rw-r--r--spec/unit/knife/configure_spec.rb2
3 files changed, 5 insertions, 4 deletions
diff --git a/distro/common/markdown/man1/knife-configure.mkd b/distro/common/markdown/man1/knife-configure.mkd
index f3a4ef02bb..b441dc5d8b 100644
--- a/distro/common/markdown/man1/knife-configure.mkd
+++ b/distro/common/markdown/man1/knife-configure.mkd
@@ -33,10 +33,11 @@ the specified _directory_.
* On a freshly installed Chef Server, use _knife configure -i_ to
create an administrator and knife configuration file. Leave the
field blank to accept the default value. On most systems, the
- default values are acceptable.
+ default values are acceptable (except for the chef server URL,
+ there you must add your organization name)
user@host$ knife configure -i
- Please enter the chef server URL: [http://localhost:4000]
+ Please enter the chef server URL: [http://localhost/organizations/myorg]
Please enter a clientname for the new client: [username]
Please enter the existing admin clientname: [chef-webui]
Please enter the location of the existing admin client's private key: [/etc/chef/webui.pem]
diff --git a/lib/chef/knife/configure.rb b/lib/chef/knife/configure.rb
index e726e32684..48007bbee7 100644
--- a/lib/chef/knife/configure.rb
+++ b/lib/chef/knife/configure.rb
@@ -133,7 +133,7 @@ EOH
def ask_user_for_config
server_name = guess_servername
- @chef_server = config[:chef_server_url] || ask_question("Please enter the chef server URL: ", :default => "https://#{server_name}:443")
+ @chef_server = config[:chef_server_url] || ask_question("Please enter the chef server URL: ", :default => "https://#{server_name}/organizations/myorg")
if config[:initial]
@new_client_name = config[:node_name] || ask_question("Please enter a name for the new user: ", :default => Etc.getlogin)
@admin_client_name = config[:admin_client_name] || ask_question("Please enter the existing admin name: ", :default => "admin")
diff --git a/spec/unit/knife/configure_spec.rb b/spec/unit/knife/configure_spec.rb
index e96115c056..b7802d3890 100644
--- a/spec/unit/knife/configure_spec.rb
+++ b/spec/unit/knife/configure_spec.rb
@@ -38,7 +38,7 @@ describe Chef::Knife::Configure do
let(:default_validator_key) { "/etc/chef-server/chef-validator.pem" }
let(:default_validator_key_win32) { File.expand_path(default_validator_key) }
- let(:default_server_url) { "https://#{fqdn}:443" }
+ let(:default_server_url) { "https://#{fqdn}/organizations/myorg" }
it "asks the user for the URL of the chef server" do
@knife.ask_user_for_config