Browse files

add exercise for more cookbooks section

  • Loading branch information...
jtimberman committed Feb 10, 2012
1 parent 60e6ae6 commit 209a0883f37262c38e01b5a62974e6abc70d360c
Showing with 79 additions and 0 deletions.
  1. +79 −0 guides/student-exercises/
@@ -0,0 +1,79 @@
More Cookbooks
## Objectives
* Apply apt, chef-client, and fail2ban recipes via a base role
* Add apache2 recipe to webserver role
* Download and examine the haproxy cookbook
## Acceptance Criteria
* "base" role is created with the apt, chef-client and fail2ban
* "base" role is applied to the remote target system.
* Answer the questions
## Download cookbooks
Download the following cookbooks to the local repository and extract
them in the `cookbooks` directory.
* apt
* chef-client
* fail2ban
* apache2
With a single knife command, upload all four cookbooks.
## Create base role
In the roles directory, create a `base.rb` for the base role. It
should have a run list containing the `apt`, `fail2ban` and
`chef-client` recipes.
## Add apache2 to webserver role
Add the `apache2` recipe to the `webserver` role's run list.
## Update the roles
Upload both the `base` and `webserver` roles to the Chef Server.
## Add the base role
Add the base role to be the first item in the remote target node's run list.
Run `chef-client` on the remote target node.
## Download haproxy cookbook
Download and extract the haproxy cookbook to the `cookbooks`
directory. Examine its contents but do not upload it to the Chef
Server yet. Do not apply it to the node's run list, that will be done
in the next exercise.
## Quesetions
What knife command was used to download the cookbooks from the Chef
Community Site?
What knife command was used to upload the cookbooks to the Chef
How many recipes are in the chef-client cookbook? Which one is used by
the default recipe?
How many recipes are in the apache2 cookbook? Are any of them used in
the default recipe?
Are dependencies required in the metadata for the chef-client or
apache2 cookbook?
Show the remote target node on the Chef Server with knife to answer
the following questions.
What values does it have for the `roles` and `recipes` attributes? Are
they different from earlier exercises?
What is in the node's attribute space for `apache` and `chef_client`?

0 comments on commit 209a088

Please sign in to comment.