Overview and requirements for the Chef integration
This topic provides an overview of the out-of-the-box Chef integration that is available starting with version 8.7. This topic includes the following sections:
Overview of the integration
The Chef integration (available in version 8.7), enables you to leverage Chef-solo content without having to provision a full-fledged Chef infrastructure in you environments. This feature enables you to:
- Create content (depot objects and jobs) for deploying the Chef-solo agent
- Create content (depot objects and jobs) for deploying Chef cookbooks, roles, environment, and databags.
Two new wizards enable you to execute NSH Scripts and NSH Script Jobs that are installed out-of-the-box with TrueSight Server Automation version 8.7.
The scripts import Chef cookbook(s), roles, environment, databags and pre-requisites (such as Ruby) and generate Depot Objects such as Software Depot Objects and BLPackages as well as the corresponding Deploy Jobs to help users deploy a Chef cookbook (and if needed, its prerequisites) on servers managed by TrueSight Server Automation.
The advantage of using TrueSight Server Automation to manage the deployment of Chef cookbooks is that the managed nodes are already under TrueSight Server Automation management. TrueSight Server Automation provides robust transmission, staging, simulation, deployment, scheduling, and detailed reporting capabilities.
Also, TrueSight Server Automation system administrators can perform additional activities after execution of Chef cookbooks on the nodes without having knowledge of the Ruby code, which is required to write additional cookbooks and recipes. Additionally, if the same TrueSight Server Automation system administrators are performing regulatory compliance and patching activities on these servers and if they perform the application deployment activities through TrueSight Server Automation, the entire process provides stronger control of servers in your environment. Further, cookbooks can be reused into your production environment.
As part of the Chef cookbook deployment process, TrueSight Server Automation runs scripts to install Chef-solo on the target and then executes the cookbooks through Chef-solo. You must download cookbooks and import them into TrueSight Server Automation prior to using the integration.
For more information about Chef-solo, see the Chef online technical documentation .
Requirements for the integration
Before you start using the Chef integration, ensure that the following prerequisites are met:
- Identify the OS and architecture of servers in your environment.
- Download the Ruby interpreter and its dependencies for your server OS and architecture and ensure they are deployed to the target servers. BMC recommends that you download them from the OS media to avoid any installation issues and runtime version mismatches. For an example of how to deploy applications using TrueSight Server Automation, see Walkthrough: Packaging applications with BLpackages.
- The servers on which you are planning to run Chef field kit scripts must have:
- Connectivity to the Internet (cookbooks.opscode.com must be accessible).
- Either the curl or the wget utility installed and be available in path. curl or wget is used by the Chef integration scripts in the priority order if they are available in path. If your server accesses the Internet via a proxy server and you have installed wget on the server, configure environment variables to provide information about the proxy URL, user ID, and password. For more information about configuring environment variables, see the wget documentation.
- NSH, Remote System Call Daemon (RSCD) agent, and BLCLI are required if you are executing the scripts from the command line. (BLCLI and NSH are part of the RCP Client install, but BLCLI is not part of the stand-alone NSH installer)
- The RCP console is required if you running the Chef scripts from the GUI.
- Chef uses native package management software (such as yum and apt) and package repositories of the target servers for installing the packages that are referenced in a cookbook. Ensure that targets are configured for and have access to package repositories (for example, RHN or RHN Satellite servers for Red Hat Linux) and have the appropriate package management tools installed and available in the path.
- Acquire TrueSight Server Automation credentials and perform the BLCLI authentication on the servers on which you are planning to run the Chef integration scripts so that you can connect to the TrueSight Server Automation Application Server. Use the blcred cred -acquire command to acquire credentials (blcred is part of the RCP Client installation).
- The authenticated role must have the following authorizations and object level permission on the target server and target server group:
- Ensure that the BL_AUTH_PROFILE_NAME environment variable is set to the authentication profile that you want to use.
- In addition, the authorization profile must also have following object level permissions:
- Server.* on Target Server
- ServerGroup.* on Target Server Group
- JobFolder.* on the Chef and ChefAdministration Job folders
- DepotFolder.* on Chef and ChefAdministration Depot folders
- NSHScriptJob.* on the ChefDeployScriptJob, Cookbook2BlPkgScriptJob, and the ChefPackagerScriptJob jobs present in the Jobs/Chef/ChefAdministration folder
- NSHScript.* on the ChefDeployScript, Cookbook2BlPkgScript, ChefPackagerScript scripts present in the Depot/Chef/ChefAdministration folder
The following table provides descriptions of the scripts that are available for your use out of the box, after installing TrueSight Server Automation (version 8.7 and later).
By default, the scripts are located in the <installation_directory> BMC Software > BladeLogic > NSH > br > autoimportcontent > chefscripts directory.
The Chefpackager NSH script is used to create the Chef Agent bundle and the Chef Agent deploy job.
One of the main pre-requisites for deploying Chef cookbooks on targets is that those targets must have Chef-solo agent installed on them.
This script takes the Chef-solo installer file locations as input, as well as the Ruby installer file location, as Chef depends on Ruby, and any other generic dependencies. The script also requires the OS, version and architecture as inputs.
The Cookbook2blpkg NSH script is used to create the TrueSight Server Automation objects (BLPackages, Deploy Jobs, and so on) required for deploying the cookbook.
This script creates a BLPackage and two jobs for each cookbook that is imported.
|ChefDeploy.nsh||The ChefDeploy NSH script is used by the Chef agent Deploy Job and the Chef cookbook Deploy Job and is automatically executed when those Deploy Jobs are executed.|
Where to go from here