how to configure chef workstation with chef server 11

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.


How to install and configure open source chef server 11

Thanks to Opscode and the community and Omnibus installer, installing your own

Open Source Chef Server 11 is now as easy as downloading and installing a package. Thanks to Opscode team and community involved in making it happen.

Steps required to have a working chef server and configured workstation

Assumption: You already have a ubuntu or centos system/server up and running with privilege (root/sudo) accounts.

Step 1: Configure a proper FQDN for your system.

Step 2: Download the chef server package for your platform from this site, currently only

deb and rpm files are there.

http://www.opscode.com/chef/install/

Step 3: install the package

For ubuntu based system

sudo dpkg -i chef-server-11. xxx . deb

For centos based system

sudo rpm -ivh chef-server-11xxx.rpm

This installs everything needed to run chef in /opt/chef-server

chef 11 provides a command “chef-server-ctl” to manage the various services

required to run chef server.

[root@chef11 ~]# chef-server-ctl
I don't know that command.
/opt/chef-server/embedded/bin/omnibus-ctl: command (subcommand)
cleanse
Delete *all* private chef data, and start from scratch.
graceful-kill
Attempt a graceful stop, then SIGKILL the entire process group.
help
Print this help message.
hup
Send the services a HUP.
int
Send the services an INT.
kill
Send the services a KILL.
once
Start the services if they are down. Do not restart them if they stop.
reconfigure
Reconfigure the application.
reindex
Reindex all server data
restart
Stop the services if they are running, then start them again.
service-list
List all the services (enabled services appear with a *.)
show-config
Show the configuration that would be generated by reconfigure.
start
Start services if they are down, and restart them if they stop.
status
Show the status of all the services.
stop
Stop the services, and do not restart them.
tail
Watch the service logs of all enabled services.
term
Send the services a TERM.
test
Run the API test suite against localhost.
uninstall
Kill all processes and uninstall the process supervisor (data will be preserved).

Step 4: Reconfigure your chef server.

sudo chef-server-ctl reconfigure

 Step 5: Your chef server by default takes your systems fqdn as chef server url

http://your-servers-fqdn

it automatically redirects to https://your-servers-fqdn.

Accept the certificate. and login to the Web UI using the default

id/pass: admin/p@ssw0rd1

Step 6: Change the admin password to some secure password.

Step 7: Configure your workstation

Step 7.1: Download and install chef-client from http://www.opscode.com/chef/install/ for your platform.

Step 7.2: http://wiki.opscode.com/display/chef/Workstation+Setup

Note:

  • The point to remember here for OS Chef 11, the validation keys and webui keys are now in /etc/chef-server, rather than /etc/chef
  • Chef server url for node/workstation doesn’t need a port 4000 now. simply: https://chef-server-url , will work. This is not documented yet, and can be frustrating.

Step 8: Confirm everything is setup and working fine using one of more knife commands

eg: knife client list

That’s it.

Enjoy & Get cooking.

Thanks,

Arun.

Note: Please feel free to leave your feedback and comments if you want me to elaborate certain steps or to put up some screenshots etc.


sorry state of police response

Like all citizens I always hoped and wanted to stay away from any policy issue,

but alas, here i’m. It’s 12:22 am on 24.1.2013, i called up the police control room

no. 100 thrice, to report an issue. To my shock and frustration, no one picked up the call, nor did i got a call back.

 

What if, it was really a life and death situation for anyone? The police portrays an

image and expects that we should trust them with law and order.  what happens

when no one is there to listen and respond back.

So, i was wondering, whether this sorry, uncaring attitude/state of the Pune police a

one time event or this is the current state of affairs? i’ll try to email on the email id given on the website of pune police and will see, if they respond.

would like to know the experiences of other good Samaritans/citizens.