Running plans alongside code deployments

The orchestrator's file sync client has a built-in locking mechanism that ensures your plans run in a consistent environment state. The locking mechanism prevents plans from starting while a code deployment is in progress, and it prevents new code deployments from synchronizing while a plan is running. You can disable this locking mechanism if you want to run plans and deploy code simultaneously. Consider the tradeoffs before deciding whether to disable the file sync locking mechanism.

Before you begin
Plans in Puppet Enterprise (PE) require Managing code with Code Manager.
You might want to disable the file sync locking mechanism if:
  • You want to allow code deployments to complete while plans are running.
  • You want to allow plans to start while code deployments are in progress.
  • Your code deployments don't frequently or substantially change the environment state that plans run in.
  • You aren't concerned if the environment state changes (due to a concurrent code deployment) during a plan run.
CAUTION:

When you disable the file sync locking mechanism, the environment states your plans run in might be inconsistent or change while the plans are starting, running, or finishing. This depends on when your code deployments happen and whether they happen while a plan is running. Puppet functions and plans that call other plans might behave unexpectedly if a code deployment occurs while a plan is running.

If it is important to you that your plans always run in a consistent environment state, you probably don't want to disable the file sync locking mechanism.

  1. In the PE console, go to Node groups > PE Infrastructure > PE Orchestrator.
  2. On the Classes tab, locate (or add) the puppet_enterprise::profile::plan_executor class, and set the versioned_deploys parameter to true. The full declaration is:
    puppet_enterprise::profile::plan_executor::versioned_deploys: true
    Important: Setting this parameter to true disables the file sync client's locking mechanism that usually enforces a consistent environment state for your plans. The locking mechanism prevents plans from starting while a code deployment occurs and forces code deployments to wait while a plan is in progress.

    Tasks, scripts, and apply block compilations always use the latest synced version of your code, regardless of this setting. However, after you set versioned_deploys to true, Puppet functions and plans that call other plans also use the latest synced version of your code, instead of the version of the code that was present when the plan started. Due to the possibility for the code to change during the plan run, Puppet functions and plans that call other plans might behave unexpectedly if a code deployment occurs while a plan is running.

    If you want to enforce a consistent environment state for plans, set versioned_deploys to false. If Code deployments time out while waiting for long-running plans to finish, adjust the timeouts_sync setting in your Code Manager parameters.

  3. Commit your changes.
  4. The orchestrator server doesn't automatically restart after setting this parameter, so you must restart the pe-orchestration-services service to finish applying the change. To do this, run the following command on the primary server:
    service pe-orchestration-services reload
Results
Plans and code deployments now start and finish without blocking each other.