Every Chef installation needs a Chef Repository. This one was created for installing the Opscode Chef Fundamentals training on a node with Showoff already configured. This repo fires up an Ubuntu 11.10 instance on EC2. You will need to have a "showoff" security group with port 9090 open.
This repo has an
infrastructure.yml file for use with Spiceweasel (http://bit.ly/spcwsl). To get the knife commands for deploying this infrastructure, use the command
and it will output the knife commands needed to build and deploy this basic infrastructure. The
knife ec2 server create and
knife rackspace server create commands at the end will deploy the exact configuration on 2 different cloud providers. You can use the
--parallel flag with Spiceweasel if you have
spiceweasel --parallel infrastructure.yml
Since this is for Chef Fundamentals, you can use this training private/public key combination to create workstations to hand out to the class. Chef will be installed on them already (adding an empty repo might be worthwhile). You can use the private key in the GitHub repo to connect to the machines. To "fix" the machines to be used for bootstrapping and manipulating (the "target" machines), remove Chef after the nodes have been created.
knife ssh "role:workstation" "sudo chef-client" -x ubuntu -a cloud.public_hostname -i training_rsa knife ssh "role:target" "sudo rm -vrf /etc/chef /var/chef" -x ubuntu -a cloud.public_hostname -i training_rsa
Then put the following into a gist and give the class the URL
https://raw.github.com/mattray/chef-fundamentals-repo/master/training_rsa knife search node role:workstation -a cloud.public_ipv4
This repository contains several directories, and each directory contains a README file that describes what it is for in greater detail, and how to use it for managing your systems with Chef.
cookbooks/- Cookbooks you download or create. Populate it by running the commands output by
data_bags/- Store data bags and items in .json in the repository. There is a
usersdirectory and an
mray.jsonexample for use with the
roles/- Store roles in .rb or .json in the repository. There is a
base.rbbase role that has the run list and settings for using the
You can use the
.chef/knife.rb provided with the repo, as long as you provide the proper environment variables for repository-specific configuration. If you're using the Opscode Platform, you can download one for your organization from the management console. If you're using the Open Source Chef Server, you can generate a new one with
knife configure. For more information about configuring Knife, see the Knife documentation.