Skip to content

Instantly share code, notes, and snippets.

@metaxis
Created December 9, 2010 05:13
Show Gist options
  • Save metaxis/734364 to your computer and use it in GitHub Desktop.
Save metaxis/734364 to your computer and use it in GitHub Desktop.
Role Lab

Fundamentals Class

Role Lab

__ Create a new webserver.rb role file in ../chef-repo/roles__

The new role file should include a description and a run_list that includes webserver recipe created in the previous step. See http://wiki.opscode.com/display/chef/Roles for examples.

__ Load the new webserver.rb role up to the Chef server__

knife role from file webserver.rb 

__ Show the newly loaded role__

knife role list

knife role show webserver

__ Configure your EC2 instance as the webserver using the role__

knife node run_list remove NODE 'recipe[webserver]'

knife node run_list add NODE 'role[webserver]'

__ List your running instances__

knife status --run-list

__ Show the status of only the nodes that have the webserver role using the search syntax.__

knife status "YOURSEARCH" --run-list

launch the web page.

curl <the public IP of the webserver instance>

__ Modify the role to set an attribute that changes the port the webserver runs on from port 80 to port 8080__

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