Skip to content

Instantly share code, notes, and snippets.

@lvnilesh
Last active February 24, 2018 17:07
Show Gist options
  • Save lvnilesh/5095680 to your computer and use it in GitHub Desktop.
Save lvnilesh/5095680 to your computer and use it in GitHub Desktop.
install chef server 11
http://docs.opscode.com/chef/install_server.html
http://www.ducea.com/2013/03/05/howto-migrate-to-chef-11/
wget https://opscode-omnitruck-release.s3.amazonaws.com/ubuntu/12.04/x86_64/chef-server_11.0.6-1.ubuntu.12.04_amd64.deb
sudo dpkg -i chef-server*
sudo chef-server-ctl reconfigure
sudo chef-server-ctl test
mkdir -p ~/.chef
sudo cp /etc/chef-server/chef-webui.pem ~/.chef/
sudo cp /etc/chef-server/chef-validator.pem ~/.chef/
edit .bashrc to include this line
export PATH=/opt/chef-server/embedded/bin:$PATH
exec $SHELL
knife configure -i
WARNING: No knife configuration file found
Where should I put the config file? [/root/.chef/knife.rb]
Please enter the chef server URL: [http://localhost:4000] https://198.211.106.166
Please enter a name for the new user: [root] nilesh
Please enter the existing admin name: [admin] chef-webui
Please enter the location of the existing admin's private key: [/etc/chef/admin.pem] ~/.chef/chef-webui.pem
Please enter the validation clientname: [chef-validator]
Please enter the location of the validation key: [/etc/chef/validation.pem] ~/.chef/chef-validator.pem
Please enter the path to a chef repository (or leave blank):
Creating initial API user...
Please enter a password for the new user:
Created user[nilesh]
Configuration file written to /root/.chef/knife.rb
ls -la .chef/
total 24
drwxr-xr-x 2 root root 4096 Mar 6 00:10 .
drwx------ 5 root root 4096 Mar 6 00:08 ..
-rw------- 1 root root 1679 Mar 6 00:06 chef-validator.pem
-rw-r----- 1 root root 1675 Mar 6 00:06 chef-webui.pem
-rw-r--r-- 1 root root 356 Mar 6 00:10 knife.rb
-rw-r--r-- 1 root root 1679 Mar 6 00:10 nilesh.pem
cat knife.rb
log_level :info
log_location STDOUT
node_name 'nilesh'
client_key '/root/.chef/nilesh.pem'
validation_client_name 'chef-validator'
validation_key '/root/.chef/chef-validator.pem'
chef_server_url 'https://198.211.106.166'
syntax_check_cache_path '/root/.chef/syntax_check_cache'
knife client list
chef-validator
chef-webui
knife node list
knife user list
admin
nilesh
@lvnilesh
Copy link
Author

lvnilesh commented Mar 6, 2013

The error I got on ubuntu in azure VM

ubuntu@chef11:~$ sudo chef-server-ctl test
Configuring logging...
Creating platform...
Starting Pedant Run: 2013-03-06 00:33:10 UTC
setting up rspec config for #<Pedant::OpenSourcePlatform:0x00000001e69dc0>
Configuring RSpec for Open-Source Tests
 _______  _______  _______  _______  _______  ______   _______
|       ||       ||       ||       ||       ||      | |       |
|   _   ||    _  ||  _____||       ||   _   ||  _    ||    ___|
|  | |  ||   |_| || |_____ |       ||  | |  || | |   ||   |___
|  |_|  ||    ___||_____  ||      _||  |_|  || |_|   ||    ___|
|       ||   |     _____| ||     |_ |       ||       ||   |___
|_______||___|    |_______||_______||_______||______| |_______|

     _______  _______  ______   _______  __    _  _______
    |       ||       ||      | |   _   ||  |  | ||       |
    |    _  ||    ___||  _    ||  |_|  ||   |_| ||_     _|
    |   |_| ||   |___ | | |   ||       ||       |  |   |
    |    ___||    ___|| |_|   ||       ||  _    |  |   |
    |   |    |   |___ |       ||   _   || | |   |  |   |
    |___|    |_______||______| |__| |__||_|  |__|  |___|

                    "Accuracy Over Tact"

                  === Testing Environment ===
                 Config File: /var/opt/chef-server/chef-pedant/etc/pedant_config.rb
       HTTP Traffic Log File: /var/log/chef-server/chef-pedant/http-traffic.log

Running tests from the following directories:
/opt/chef-server/embedded/service/chef-pedant/spec/api
Ruby?  Erlang? true
Run options:
  include {:focus=>true, :smoke=>true}
  exclude {:platform=>:multitenant, :cleanup=>true}
Creating client pedant_admin_client...
Exception during Pedant credentials setup
#<Errno::ECONNREFUSED: Connection refused - connect(2)>
/opt/chef-server/embedded/lib/ruby/1.9.1/net/http.rb:762:in `initialize'
/opt/chef-server/embedded/lib/ruby/1.9.1/net/http.rb:762:in `open'
/opt/chef-server/embedded/lib/ruby/1.9.1/net/http.rb:762:in `block in connect'
/opt/chef-server/embedded/lib/ruby/1.9.1/timeout.rb:54:in `timeout'
/opt/chef-server/embedded/lib/ruby/1.9.1/timeout.rb:99:in `timeout'
/opt/chef-server/embedded/lib/ruby/1.9.1/net/http.rb:762:in `connect'
/opt/chef-server/embedded/lib/ruby/1.9.1/net/http.rb:755:in `do_start'
/opt/chef-server/embedded/lib/ruby/1.9.1/net/http.rb:744:in `start'
/opt/chef-server/embedded/service/gem/ruby/1.9.1/gems/rest-client-1.6.7/lib/restclient/request.rb:172:in `transmit'
/opt/chef-server/embedded/service/gem/ruby/1.9.1/gems/rest-client-1.6.7/lib/restclient/request.rb:64:in `execute'
/opt/chef-server/embedded/service/gem/ruby/1.9.1/gems/rest-client-1.6.7/lib/restclient/request.rb:33:in `execute'
/opt/chef-server/embedded/service/gem/ruby/1.9.1/gems/rest-client-1.6.7/lib/restclient.rb:72:in `post'
/opt/chef-server/embedded/service/chef-pedant/lib/pedant/request.rb:103:in `authenticated_request'
/opt/chef-server/embedded/service/chef-pedant/lib/pedant/request.rb:125:in `post'
/opt/chef-server/embedded/service/chef-pedant/lib/pedant/opensource/platform.rb:81:in `create_client'
/opt/chef-server/embedded/service/chef-pedant/lib/pedant/opensource/platform.rb:122:in `client_from_config'
/opt/chef-server/embedded/service/chef-pedant/lib/pedant/opensource/platform.rb:40:in `block in setup'
/opt/chef-server/embedded/service/chef-pedant/lib/pedant/opensource/platform.rb:35:in `each'
/opt/chef-server/embedded/service/chef-pedant/lib/pedant/opensource/platform.rb:35:in `setup'
/opt/chef-server/embedded/service/chef-pedant/lib/pedant.rb:102:in `block (2 levels) in configure_rspec'
/opt/chef-server/embedded/service/gem/ruby/1.9.1/gems/rspec-core-2.11.1/lib/rspec/core/hooks.rb:23:in `instance_eval'
/opt/chef-server/embedded/service/gem/ruby/1.9.1/gems/rspec-core-2.11.1/lib/rspec/core/hooks.rb:23:in `run'
/opt/chef-server/embedded/service/gem/ruby/1.9.1/gems/rspec-core-2.11.1/lib/rspec/core/hooks.rb:72:in `block in run'
/opt/chef-server/embedded/service/gem/ruby/1.9.1/gems/rspec-core-2.11.1/lib/rspec/core/hooks.rb:72:in `each'
/opt/chef-server/embedded/service/gem/ruby/1.9.1/gems/rspec-core-2.11.1/lib/rspec/core/hooks.rb:72:in `run'
/opt/chef-server/embedded/service/gem/ruby/1.9.1/gems/rspec-core-2.11.1/lib/rspec/core/hooks.rb:424:in `run_hook'
/opt/chef-server/embedded/service/gem/ruby/1.9.1/gems/rspec-core-2.11.1/lib/rspec/core/command_line.rb:27:in `block in run'
/opt/chef-server/embedded/service/gem/ruby/1.9.1/gems/rspec-core-2.11.1/lib/rspec/core/reporter.rb:34:in `report'
/opt/chef-server/embedded/service/gem/ruby/1.9.1/gems/rspec-core-2.11.1/lib/rspec/core/command_line.rb:25:in `run'
/opt/chef-server/embedded/service/gem/ruby/1.9.1/gems/rspec-core-2.11.1/lib/rspec/core/runner.rb:69:in `run'
./bin/chef-pedant:29:in `<main>'

Finished in 0.19062 seconds
0 examples, 0 failures
ubuntu@chef11:~$

@revirth
Copy link

revirth commented Apr 22, 2013

@lvnilesh change hostname and add 'amazon' case in /opt/chef-server/embedded/cookbooks/runit/recipes/default.rb

http://dev.classmethod.jp/server-side/chef-server-install/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment