Note: Please go to docs.rightscale.com to access the current RightScale documentation set. Also, feel free to Chat with us!
Home > ServerTemplates > Open Source > Chef Development Environment (CDE) > Chef Development Environment (CDE) - Tutorial

Chef Development Environment (CDE) - Tutorial

 

 

 


Table of Contents    

RightScale Open Source

logo_lg_rightscaleopensource.png

Useful ServerTemplate assets

    ►  Tutorial
  • Reference

 

RS Open Source Disclaimer

ServerTemplates published by "RightScale Open Source" consist of assets published by RightScale that do not belong to a standard LTS or Infinity branch. They are typically developed by one of the Professional Services, Technical Support or Sales Engineering teams. As such, they do not go through the more rigorous QA and testing cycles. Support is via the RightScale Community and a Service Level Agreement (SLA) does not apply.

Note:  Not all RS Open Source assets are documented on the Support Portal.  See the MultiCloud Marketplace for additional RightScale Open Source ServerTemplates.

Objective

To set up a standard Chef development environment using an instance in the cloud for modifying cookbooks.

Prerequisites

  • 'actor', 'designer' and 'library' user role privileges in the RightScale account. 

Overview

This tutorial describes the steps for using an instance in the cloud for setting up a Chef development environment.

For a technical overview of this ServerTemplate, see Chef Development Environment (CDE) - Overview.

Steps

Create a Deployment

  1. Create a New Deployment. It's recommended that you launch the CDE server in its own deployment to keep the inputs isolated, however you can add it directly to a test deployment, if preferred.

Create a Chef Development Server

diag-Chef_Dev_Server-v1.png

  1. Go to the MultiCloudMarketplace (Design > MultiCloud Marketplace > ServerTemplates) and import the following ServerTemplate:
  2. Add a server into the new deployment using the latest revision of the imported ServerTemplate. Select or create any required cloud resources. For this tutorial, please launch an EC2 instance. Therefore, you will need to select an SSH key and Security Group. Make sure the security group has TCP ports 22 and 80 open to any IP. (Tip: If you create a new Security Group from the wizard, it will automatically have the appropriate permissions to complete this tutorial.) Name the server accordingly.  (e.g. My Chef Dev) See the Add Server Assistant page if you need help adding a server to a deployment. 
  3. Go to the deployment's Inputs tab and set the following inputs. Note: You will need to click the "Show Advanced inputs" link to view all of the inputs listed below.

GIT

Input Name
Description
Example Value

Git email address

The email address associated with your GitHub account. (e.g. text: user@example.com)

Tip:  Log into your Git account to find your associated email address under Account Settings.  (Upper right, wrench/screwdriver icon.)

text: you@example.com

Git SSH key used for read/write access Select the same EC2 SSH key that you used to create the server. (e.g. key: my-key) key: my-key
Git user name Enter your Git username. (e.g. text: username) text: myusername
Git branch

Enter the name of the Git branch you want to pull code from. (e.g. mybranch)

If unspecified, the "master" branch will be used.

text: mybranch
Git Repository

The URI to your Git repository where you have read + write access. 

Important! You must use the 'SSH' not 'HTTP' URI.

(e.g. git@github.com:username/myrepo.git)

text: git@github.com:username/myrepo.git

 

  1. Go to the deployment's Servers tab and launch the CDE server. 
  2. (Optional) Once the server becomes operational, you can SSH into the instance and see your new working directory. A script is run at boot time to retrieve your cookbooks from the specified repository and store them locally on the instance. 
# cd /opt/development

Create a Git SSH Key

In order to push code to a GitHub repository or pull code from a private repository, an SSH key is used for authentication purposes. For this tutorial, you will use the EC2 SSH key as your Git SSH key. Remember, you selected your EC2 SSH key when you launched the server. You will use the public key as your "Git SSH Key" so that you will be able to push changes from your Chef development server to your GitHub repository.

  1. SSH into the running server and switch to the root user so that you will be allowed to navigate to the .ssh directory.
    • # sudo -i
  2. Run the following command to retrieve the public SSH key of the EC2 SSH key that you used to launch the server.
    • # cat ~/.ssh/*.pub
  3. Copy the contents of the public key.
  4. Log into GitHub and go to your Account Settings > SSH Keys.
  5. Click the Add New SSH Key button. Provide a name for the SSH Key and paste the contents of your public key into the "Key" field. (view screenshot)
  6. Click Add Key. Note: You will be prompted to enter your GitHub password for authentication purposes.

Update Cookbooks

You are now ready to update cookbooks on the CDE server and push the committed changes to your Git repository. You should always test your changes with a separate "test" server.

diag-Chef_Dev_Environment-v2.png

See the following documents for examples.

You must to post a comment.
Last modified
00:31, 17 May 2013

Tags

Classifications

This page has no classifications.

Announcements

None


© 2006-2014 RightScale, Inc. All rights reserved.
RightScale is a registered trademark of RightScale, Inc. All other products and services may be trademarks or servicemarks of their respective owners.