Custom deployment policies
If the built-in deployment policies included with Continuous Delivery for Puppet Enterprise (PE) don't align with how your organization uses PE, you can write custom deployment policies tailored to your needs.
- Include Git processes in your chosen source control provider.
- Use Puppet orchestrator to make changes to your node groups.
- Run Bolt tasks and plans
- Issue automatic notifications via the third-party services, such as Slack and ServiceNow
Custom deployment policies use the
puppetlabs-cd4pe_deployments module, which is built into Continuous Delivery for PE. This means you don't need to download or install
anything in order to use custom deployment policies. For a full list of functions and
variables you can use in your custom deployment policies, refer to the
puppetlabs-cd4pe_deployments module's README and REFERENCE on GitHub. Also in the module's GitHub repository, we've rewritten the built-in deployment policies as custom
policies so you can use these examples when writing your own policies.
Warnings and restrictions
Add a custom deployment policy to your control repo
Each custom deployment policy file must be stored in a module, named
deployments, in the control repo that uses the policy.
production branch. If your control repo
doesn't have a
production branch, or you want to store
custom deployment policies on a different branch, you must manage your pipelines as
code and tell Continuous Delivery for PE where to find your custom
deployment policy files.
- Open the pipeline's
- Locate the
deployment_policy_branchto the branch where the custom deployment policy files are stored.
production branch, or you want to store custom deployment policies on
a different branch, you must use pipelines-as-code and specify the
deployment_policy_branch setting, as explained
These requirements don't apply if your control repo has a
production branch and you'll store your
custom deployment policy files on that branch.
Write your custom deployment policy, as explained in the
puppetlabs-cd4pe_deploymentsmodule's README on GitHub.
In your control repo, go to the branch where your custom deployment policy
files are stored. This is either the
productionbranch or another branch you specified in your pipeline's
.cd4pe.yamlfile.Remember: If your control repo doesn't have a
productionbranch, or you want to store custom deployment policies on a different branch, you must use pipelines-as-code and specify the
deployment_policy_branchsetting, as explained above.
Create a new Puppet module named
deployments, and store it in one of the following directories in your control repo:
You must store the module in one of these specific directories so Continuous Delivery for PE can find and run your custom deployment policies.
Add your custom deployment policy file to the
/plansdirectory in the