Permalink
Browse files

update roles section

  • Loading branch information...
jtimberman committed Feb 7, 2012
1 parent 80341ac commit 1de8009700cfd4e47f88dca7676b188da32a3d1d
Showing with 39 additions and 22 deletions.
  1. +12 −5 guides/student-exercises/roles.md
  2. +27 −17 slides/roles/01_slide.md
@@ -15,24 +15,31 @@ Roles
## Create Base Role
Create a directory to store roles in the Chef Repository. It should be named `roles`. Create a role named `base` as a Ruby DSL file in the `roles` directory. Add the `fail2ban` cookbook to the role's run list.
Create a directory to store roles in the Chef Repository. It should be
named `roles`. Create a role named `base` as a Ruby DSL file in the
`roles` directory. Add the `fail2ban` cookbook to the role's run list.
Upload the `base` role to the Chef Server.
## Modify Node
Use `knife` to remove the `fail2ban` recipe from the node's run list and add the `base` role.
Use `knife` to remove the `fail2ban` recipe from the node's run list
and add the `base` role.
Re-run `chef-client` on the node.
## Questions
What are the required components of a role?
How can the contents of the role on the Chef Server be displayed? What command-line option will show the JSON source?
How can the contents of the role on the Chef Server be displayed? What
command-line option will show the JSON source?
What `knife` command is used to display only the node's run list?
When `chef-client` is run again on the node, what is the content of the `roles` attribute on the node object? What is the content of `recipes`? What is the run list?
When `chef-client` is run again on the node, what is the content of
the `roles` attribute on the node object? What is the content of
`recipes`? What is the run list?
When `chef-client` is run again on the node, did it make any changes to the managed resources?
When `chef-client` is run again on the node, did it make any changes
to the managed resources?
View
@@ -1,16 +1,14 @@
# Roles
.notes These course materials are Copyright © 2010-2012 Opscode, Inc. All rights reserved.
This work is licensed under a Creative Commons Attribute Share Alike 3.0 United States License. To view a copy of this license, visit http://creativecommons.org/licenses/by-sa/3.0/us; or send a letter to Creative Commons, 171 2nd Street, Suite 300, San Francisco, California, 94105, USA.
Section Objectives:
# Objectives
* Understand the components of a role
* Create roles with the Ruby DSL
* View roles on the Chef Server
* Apply roles to nodes
At completion of this unit you should...
* Understand the components of a role.
* Know recommended practices for roles.
* Be able to create a new role.
* Be able to apply roles to nodes.
.notes These course materials are Copyright © 2010-2012 Opscode, Inc. All rights reserved.
This work is licensed under a Creative Commons Attribute Share Alike 3.0 United States License. To view a copy of this license, visit http://creativecommons.org/licenses/by-sa/3.0/us; or send a letter to Creative Commons, 171 2nd Street, Suite 300, San Francisco, California, 94105, USA.
# Components of a Role
@@ -86,9 +84,12 @@ This contains the basics that all systems should have.
# Per-service Roles
In a service oriented architecture, each different service should have its own role with the recipes that determine how to fulfill that service.
In a service oriented architecture, each different service should have
its own role with the recipes that determine how to fulfill that
service.
For example, it is common in a web-application architecture to have webservers.
For example, it is common in a web-application architecture to have
webservers.
# roles/webserver.rb
@@ -168,13 +169,22 @@ Use knife:
# Summary
You should now be able to...
* Understand the components of a role
* Create roles with the Ruby DSL
* View roles on the Chef Server
* Apply roles to nodes
# Questions
* Describe the components of a role.
* Describe recommended practices for roles.
* Create a new role.
* Apply roles to nodes.
* What are the components of a role?
* What is the difference between the Ruby DSL and JSON for roles?
* What knife command is used to add a role to a node's run list?
* What knife command sends the role to the Chef Server from the local repository?
# Lab Exercise
## Roles
Roles
* Understand how to create roles with the Ruby DSL
* Upload a role to the Chef Server with knife
* Modify a node's run list directly with knife

0 comments on commit 1de8009

Please sign in to comment.