Chef plugin

This cloud provisioner plugin enables integration with Chef. There are two options for the integration: - Install Chef-Solo by orchestration and run recipes on the target - Create and upload your RapidDeploy orchestration tasks as recipes to Chef server.

Prerequisites

If you want to create recipes from RapidDeploy tasks for your existing Chef infrastructure, Chef workstation has to be installed on the server machine for effective integration (otherwise your recipes will be generated locally)

Usage

  • Installing Chef-Solo and running recipes on the target

    1. Install Chef-Solo on target:

    • for Windows targets, you have to package the Chef-client installer into the deployment file.
    • for Linux targets, no additional files needed.

    2. Run recipes on target: you need to specify the configuration and task file for Chef-Solo, and package your cookbooks into the deployment package. You can specify the cookbooks folder relative from the config file.

Example solo.rb

        
chefSoloRoot = File.absolute_path(File.dirname(__FILE__))
data_bag_path chefSoloRoot + '/data-bags'
file_cache_path chefSoloRoot                    
cookbook_path [chefSoloRoot + '/cookbooks']
                        

Example solo.json

{
"run_list":[
"recipe[apache2]",
"recipe[networking_basic]",
"recipe[aliases]"]
}
                        

Directory structure:

  • Chef data folder
    • Cookbooks folder
      • Apache2 cookbook folder
      • Networking basic cookbook folder
      • Aliases cookbook folder
    • Chef solo config file (solo.rb)
    • Chef task file (solo.json)

Packaging orchestration into a recipe

Go to Help/Extensions, select Chef integration and enable it. On the extensions page, you can set the configuration of your chef installation. Specify the chef workspace folder, or if the workspace is not installed, select a directory to hold your cookbooks and check work offline. Select name and version, then build a dependency cookbook. This will contain all the necessary jar files for RapidDeploy orchestration, so other cookbooks will depend on this. The cookbook will be created shortly.

To create a cookbook from your project, make sure you have enabled the integration with Chef checkbox, then go to the project panel. Set the version of the cookbook, so it will build and upload the cookbook with that version. Select one of your environments, so the data dictionary items from that environment will be used as default values in the recipe. Set recipe name, so a recipe with that name will be created under the specified cookbook name, which can run the current orchestration tasks. Set cookbook name, so the recipe and the file resources will be generated under that cookbook. Click on Build recipe button, so it will start the build process included the following actions: - create directory structure for the cookbook - generate a recipe which is able to run the orchestration tasks with the provided file resources - copy the project files under /files/default/[Projectname]/. An additional environment dictionary file will be generated in each project root called DefaultServer.DefaultEnvironment.DefaultInstance.DefaultApplication.dict. This will contain the variables required to use Chef attributes. - generate an attributes file extracting the parameters from the selected environment, saving it under /attributes/[Projectname.rb]

Recipe attributes

When generating the recipes, a list of attributes is generated in the corresponding attributes file: - the list of the RapidDeploy environments, and the selected environment name. - the list of parameters needed to run the orchestration tasks.

The default environment is selected by default. By using the default environment, you can use the attributes list for the tasks below, so the specified values will be replaced runtime. In case you want to use a preconfigured RapidDeploy environment, you can change the selected environment name value to one of the names listed at the top. In this case, the task attributes at the bottom will not be used.

Note that recipes can only use code deploy type projects. Binary install types are not supported.

Attributes and parameters

List and description of all user interface plugin parameters.