Direct Puppet: a workflow for controlling change
The orchestrator—used alongside other PE tools, such as Code Manager—allows you to control when and how infrastructure changes are made before they reach your production environment.
The Direct Puppet workflow gives you precise control over rolling out changes, from updating data and classifying nodes, to deploying new Puppet code. In this workflow, you configure your agents to use cached catalogs during scheduled runs, and you send new catalogs only when you're ready, via orchestrator jobs. Scheduled runs continue to enforce the desired state of the last orchestration job until you send another new catalog.
Direct Puppet workflow
In this workflow, you set a up a node group for testing and validating code on a feature branch before you merge and promote it into your production environment.
- To use this workflow, you must enable cached catalogs for use with the orchestrator so that they enforce cached catalogs by default and compile new catalogs only when instructed to by orchestrator jobs.
- This workflow also assumes you’re familiar with Code Manager. It involves making changes to your control repo—adding or updating modules, editing manifests, or changing your Hiera data. You’ll also run deploy actions from the Code Manager command line tool and the orchestrator, so ensure you have access to a host with PE client tools installed.
Set up node groups for testing new features
The first step in the Direct Puppet workflow is to set up node groups for testing your new feature or code.
Create a feature branch
After you've set up a node group, create a new branch of your control repository on which you can make changes to your feature code.
Deploy code to the Puppet master and test it
Now that you've made some changes to the code on your feature branch, you're ready to use Code Manager to push those to the Puppet master.
Merge and promote your code
If everything works as expected on the development nodes, and you're ready to promote your changes into production.
Preview the job
Before running Puppet
across the production
environment, preview
the job with the puppet job plan
command.
production
environment, as well as the agent-specified
development nodes that just ran with the my_feature_branch
environment, use the following
query as the job target:
puppet job plan --query 'inventory {environment in ["production", "my_feature_branch"]}
Run the job on the production environment
If you're satisfied with the changes in the preview, you're
ready to enforce changes to the production
environment.
puppet job run --query 'inventory {environment in ["production", "my_feature_branch"]}
Validate your production changes
Finally, you're ready to validate your production changes.
Check the node run reports in the console to confirm that the changes were applied as intended. If so, you're done!
Repeat this process as you develop and promote your code.