Integrating with Puppet

You can integrate with Puppet to achieve the following goals: 

  • Run BMC Release Package and Deployment (RPD) processes through Puppet Agents
  • Run Puppet modules as a part of the RPD processes

With this integration, you can perform your deployments by using the RPD interface and through your existing Puppet setup. Thus, you can perform your deployments on remote target servers by using your existing Puppet Agents.

You can use the set of default actions available for this integration to trigger your deployments tasks. For more information, see Puppet actions.

Environment requirements

Ensure that the following requirements are met to successfully integrate with Puppet and perform your deployments:

  1. Ensure that the RPD dispatcher is running on the same computer as the Puppet Master.

    Note

    If you need multiple dispatchers for load distribution, then you must have multiple Puppet Masters set up in your environment. You need one dispatcher for every single Puppet Master.

  2. Ensure that you have Puppet Agents installed in your environment. The Puppet Agents must be defined as nodes on the Puppet Master.

    Note

    While creating servers on RPD, you must use the same host name (fully qualified domain name) as that of the server on which the Puppet Agent is running.

  3. Configure an ENC for the dispatcher on the Puppet Master server. 
  4. Add the following code block to the ENC so that it allows RPD to post dynamic class definitions to the Puppet Agents:

    #################################
    # RLM External Node Classifier
    #################################
    PUPPET_ENC_TMP=/tmp/rlm_enc
    RLM_FILES=`find $PUPPET_ENC_TMP -name "RLM_${1}*" | sort -n |  head -1`
    if [ -n "$RLM_FILES" ]; then
        echo "classes:"
        cat $RLM_FILES
        echo "name: ${1}"
        echo "parameters: {}"
    else
        # Current ENC code here
    fi

Performing a deployment by using Puppet

The following steps summarize the high level process involved in carrying out a deployment using your existing Puppet setup:

  1. Deployments are broken up into processes for each target (server) on RPD.
  2. Puppet classes are created and added to an External Node Classifier (ENC) to be returned to the Puppet Master during the next Puppet Agent run. These classes contain details regarding each of the deployment tasks (included in the processes on RPD).
  3. When the Puppet class is invoked on the Agent, the Puppet Master is notified.
  4. RPD receives a notification that the Puppet classes got invoked on the Agent. Once this happens, the Agent class definitions are removed from the ENC.

    There is no way to determine the success or failure of the Puppet process, only that it was run.

    If no notification is received about the the Puppet class execution, then the process goes into an error state.

    Note

    Deployments do not occur until the process post deployment activities for the deployment task are successfully completed. Each deployment process triggers the generation of manifests that are needed to perform the deployment task. Deployment failures do not occur until the final process fully runs and the post deployment activities for that process are completed.

Integration workflow

The following figure and the associated steps describe the integration between Puppet and RPD:

Integration workflow

Puppet integration diagram

Sample use case

The following use case describes an end to end deployment process involved for this integration:

Use case for Puppet integration

This use case describes the deployment of a zip file on a target server by using the Puppet setup and executing a Puppet module as a part of the deployment process.

This deployment is described in the following steps:

  1. John logs on to his Puppet setup and performs the following setup tasks:
    1. Configure a dispatcher on the Puppet Master server. For more information about installing a dispatcher without running the installation program, see Installing and starting dispatchers and bridges.
    2. Configure an ENC for the dispatcher on the Puppet Master server.
    3. Add the following code block to the ENC:

      #################################
      # RLM External Node Classifier
      #################################
      PUPPET_ENC_TMP=/tmp/rlm_enc
      RLM_FILES=`find $PUPPET_ENC_TMP -name "RLM_${1}*" | sort -n |  head -1`
      if [ -n "$RLM_FILES" ]; then
          echo "classes:"
          cat $RLM_FILES
          echo "name: ${1}"
          echo "parameters: {}"
      else
          # Current ENC code here
      fi
  2. He then logs on to RPD and creates a server pointing to the Puppet Agent and the dispatcher so that RPD can connect with Puppet. For this, he navigates to System > Servers > New Server. He provides the following details and then clicks Create.
    1. Hostname: The Puppet Agent server name
    2. Create Channel Template: None
    3. Role: Unassigned
    4. Agent: Puppet
    5. Dispatcher Server: Name of the server where the dispatcher is running.
    6. Remote Platform: None
  3. He now navigates to the Topology tab to create a topology consisting of channel templates, channels, environments, and routes necessary to perform the deployment, as follows:
    1. On the Topology > Channel Templates > New Channel Template page, provide the necessary details to create a channel template, "Puppet_CT1:"
    2. On the Topology > Channels > New Channel page, select "Puppet_CT1" as the channel template, and provide other necessary details to create a channel named, "Puppet Channel 1."
    3. On the Topology > Environments > New Environment page, provide the necessary details to create an environment named, "Puppet Env 1."
    4. On the Topology > Routes > New Route page, create a route named "Puppet Route" by selecting the Type as Strict. Assign the "Puppet Env 1" to this route by dragging it from the Available Environments panel to the Environments panel.
      For more information about creating a topology, see Creating and managing the deployment topology.
  4. He navigates to the Define > Packages > New Packagepage, and provides details to create a package named, "Puppet Package." He adds a reference and an instance for this package, as follows:
    1. Click Add Reference to add a reference regarding the zip file by providing the necessary details and selecting the Method as File.
    2. Click New Instance next to the package summary and provides the necessary details and create the instance.
      For more information about creating a package and adding references and an instance for that package, see Packages.
  5. He navigates to the Define > Processes > New Process page and creates a process called "Puppet Deploy zip file." He adds the following deployment activities on the Deployment Activities tab and then clicks Done:
    1. Create an activity called, "Send content" by using the Send Instance Content activity library to send the content pack to the appropriate directory on the target server.
    2. Create an activity called, "Unzip content pack" by using the Execute Command Line activity library to unzip the content pack on that directory. Add a dependency for the preceding activity.
    3. Create an activity called, "Copy directory" by using the Copy File or Directory activity library to copy the unzipped content pack to another directory on the deploy server. Add a dependency for the preceding activity.
    4. Create an activity called, "Puppet Module - Core Permissions" by using the Invoke Action activity library to execute the core_permissions Puppet module and add a dependency for the preceding activity. Under the Configure panel, ensure that Generic is selected as the value in the first list available for Action Name. Select Execute Puppet Module in the second list available for Action Name. In the Action Arguments box, specify core_permissions. Click Done.
      For more information on creating processes, see Creating and managing processes and content process sets.
  6. He navigates to the Deploy tab and deploys the relevant package. When the deployment begins, the Puppet Agent runs and the process starts executing on the target servers.
    For more information about performing a deployment, see Creating and managing deployments.
  7. He checks the Puppet Agent log to verify if the deployment was successful or not.

Limitations

The following issues limit the scope of this integration:

  • The Config Get action used for pulling the configuration data from the Puppet Master server into RPD is not supported for remote platforms such as the Puppet Agents. It is only supported on the Puppet Master server where the Dispatcher is running, to pull modules and manifest names from the Puppet Master server.
  • The Dispatch Fileget action is not supported for this integration.
  • The dispatch_prun action is not supported for this integration.

Related topic

Puppet actions

Was this page helpful? Yes No Submitting... Thank you

Comments