So I figured, even configuration of chef workstation with chef server 11 is a bit different.
This is how I’ve configured my chef workstation with my open source chef server 11. Please note: I’m firing all these commands from my chef workstation.
First, i created a folder where i want to have all my code.
➜ /tmp mkdir chef11 ➜ /tmp cd chef11
Then clone the chef repo.
➜ chef11 git clone https://github.com/opscode/chef-repo.git Initialized empty Git repository in /tmp/chef11/chef-repo/.git/ remote: Counting objects: 202, done. remote: Compressing objects: 100% (121/121), done. remote: Total 202 (delta 73), reused 160 (delta 48) Receiving objects: 100% (202/202), 34.25 KiB | 5 KiB/s, done. Resolving deltas: 100% (73/73), done.
Create a .chef folder inside the chef-repo and create a empty knife.rb file.
➜ chef11 cd chef-repo ➜ chef-repo git:(master) pwd /tmp/chef11/chef-repo ➜ chef-repo git:(master) mkdir .chef ➜ chef-repo git:(master) cd .chef ➜ .chef git:(master) ls ➜ .chef git:(master) touch knife.rb
In my case, my chef server is named and chef11.linuxguy.in and is resolvable by my dns. you can use the ip or fqdn, once you configure it into your hosts file.
Anyways, what you need is admin.pem and chef-validator.pem files from the chef server 11. These are located in /etc/chef-server
Note: In earlier version of open source chef server, we needed 2 files, validation.pem and webui.pem, and they used to be in /etc/chef on the chef server.
➜ .chef git:(master) ✗ scp root@chef11.linuxguy.lan:/etc/chef-server/admin.pem . Warning: Permanently added 'chef11.linuxguy.lan' (RSA) to the list of known hosts. root@chef11.linuxguy.lan's password: admin.pem 100% 1675 1.6KB/s 00:00 ➜ .chef git:(master) ✗ scp root@chef11.linuxguy.lan:/etc/chef-server/chef-validator.pem . root@chef11.linuxguy.lan's password: chef-validator.pem 100% 1679 1.6KB/s 00:00
➜ .chef git:(master) ✗ ls admin.pem chef-validator.pem knife.rb
➜ chef-repo git:(master) ✗ pwd /tmp/chef11/chef-repo
Now configure your knife.rb
➜ chef-repo git:(master) ✗ knife configure -i Overwrite /tmp/chef11/chef-repo/.chef/knife.rb? (Y/N) y Please enter the chef server URL: [http://router.linuxguy.lan:4000] https://chef11.linuxguy.lan Please enter a name for the new user: [arun] testuser Please enter the existing admin name: [admin] admin Please enter the location of the existing admin's private key: [/etc/chef/admin.pem] .chef/admin.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[testuser] Configuration file written to /tmp/chef11/chef-repo/.chef/knife.rb
➜ chef-repo git:(master) ✗ cd .chef ➜ .chef git:(master) ✗ ls admin.pem chef-validator.pem knife.rb testuser.pem ➜ .chef git:(master) ✗ cd ..
Now confirm whether you can access your chef server or not.
➜ chef-repo git:(master) ✗ knife user list admin ak crazy testuser
That’s it.
Enjoy.
Arun Tomar.
Note: Please leave your valuable feedback and comments to improve it or if i made any mistake.