Skip to content

Instantly share code, notes, and snippets.

@botchagalupe
Created November 30, 2010 02:21
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save botchagalupe/721028 to your computer and use it in GitHub Desktop.
Save botchagalupe/721028 to your computer and use it in GitHub Desktop.
TSE Training Setup - Ubuntu (Student Notes)

Setup a Student Chef Client on Ubuntu

ssh ubuntu@<IP Supplied by the Instructor>  (password opstrain_0150)

mkdir -p ~/chef-repo/.chef

From your Client box copy your Key and config files

cp USERNAME.pem ~/chef-repo/.chef
cp ORGANIZATION-validator.pem ~/chef-repo/.chef
cp knife.rb ~/chef-repo/.chef

_ Create and run Chef Client Boot Script_

if [ ! -f /usr/bin/chef-client ]; then
  apt-get update
  apt-get install -y ruby ruby1.8-dev build-essential wget libruby-extras libruby1.8-extras
  cd /tmp
  wget http://production.cf.rubygems.org/rubygems/rubygems-1.3.7.tgz
  tar zxf rubygems-1.3.7.tgz
  cd rubygems-1.3.7
  ruby setup.rb --no-format-executable
fi

gem install ohai chef --no-rdoc --no-ri --verbose

sudo apt-get -y install libxml2 libxml2-dev libxslt1-dev git-core

sudo gem install net-ssh net-ssh-multi fog highline --no-rdoc --no-ri --verbose

mkdir -p /etc/chef

Validate the install and setup

cd ~/chef-repo 

knife client list

Complete the Client install

Generate your Chef client configuration

cd ~/chef-repo
knife configure client ./client-config

You'll now have a client-config directory in your local repository:

ls -l client-config
-rw-r--r--   1 adam  staff   155 Jun 18 16:03 client.rb
-rw-r--r--@  1 adam  staff  1679 Jun 18 16:03 validation.pem

sudo cp ~/chef-repo/client-config/* /etc/chef

Run Chef for the first time

knife node list
[

]

Yep, we have no nodes.

Lets run Chef for the first time on your workstation, and it will create one for us:

sudo chef-client

[Fri, 18 Jun 2010 16:06:12 -0700] INFO: Running report handlers
[Fri, 18 Jun 2010 16:06:12 -0700] INFO: Report handlers complete

If we look now, we'll see your workstation is in the node list:

$ knife node list
[
  "latte"
]

To see all the data we collected about your node:

$ knife node show YOURNODE

In the output above, "latte" is my workstation. You should replace YOURNODE with whatever the name is you see when you run knife node list

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