Configure impact analysis
Impact analysis is a premium Continuous Delivery tool. Please see Unlocking Impact Analysis for information on unlocking this premium feature.
Impact analysis is a Continuous Delivery tool that shows you the potential impact that new Puppet code can have on your PE-managed infrastructure, without actually merging the new code. When you add impact analysis to a control/module repo's pipeline, Continuous Delivery automatically generates a report on every proposed code change to that repo.
Configuration process and preparation
To configure impact analysis, you must set the destination server for impact analysis
tasks, install the puppetlabs-cd4pe
module, and make
a classification update.
Before configuring impact analysis, you must:
- Install Continuous Delivery along with your license for Impact Analysis
- Integrate with your source control system
- Integrate with Puppet Enterprise
Set the impact analysis destination
When you integrate a new Puppet Enterprise (PE) instance with Continuous Delivery, impact analysis tasks are automatically configured to run on the primary server. In many cases, it's better to change the impact analysis task destination to a different server, such as a compiler or load balancer, to preserve the primary server's compile capacity.
Determine a place in your PE infrastructure to direct impact analysis tasks:
- Best: A load balancer managing a pool of compilers.
- Good: An individual compiler dedicated to impact analysis tasks.
- For small installations only: The PE
primary server. The primary server is the default configuration for running impact analysis tasks, but it is best suited to PE installations with limited node counts using the standard installation architecture. Impact analysis tasks can easily overrun the primary server's limited compile capacity in a larger distributed architecture.
If you choose to run impact analysis tasks on the primary server, skip to Install modules.
To run impact analysis tasks on a load balancer or compiler:
- In the Continuous Delivery web UI, navigate to Settings > Puppet Enterprise and locate the PE instance you are configuring.
- Click More actions > Edit integration.
- If you want to run impact analysis tasks through a dedicated load balancer or
compiler, in the Puppet Server service field, enter the
hostname of the primary server or a specific compiler or load balancer at
:8140
(for example,loadbalancer.example.com:8140
).The Puppet Server service is used for impact analysis, among other processes. You can run impact analysis tasks on a compiler or load balancer instead of the primary server. This is strongly recommended for PE installations that use compilers or load balancers as part of their architecture. - Optional: You can expand the Impact Analysis Settings section to adjust the maximum number of catalogs that Continuous Delivery is able to simultaneously compile, as explained in Optional impact analysis settings.
- Click Save Changes.
Optional impact analysis settings
To adjust these optional settings, edit your Puppet Enterprise (PE) integration settings and expand the Impact Analysis Settings section.
Concurrent catalog compilations
This setting sets the maximum number of catalog compilations Continuous Delivery is permitted to perform simultaneously. By default, Continuous Delivery performs up to 10 concurrent catalog compilations.
Tune this number to fit the needs and limitations of your installation. A lower number preserves processing capacity, while a higher number reduces the time Continuous Delivery spends completing each impact analysis task.
Install modules
Impact analysis requires you to install the puppetlabs-cd4pe
module and its dependent modules.
- Add the
puppetlabs-cd4pe
module, its dependencies, and thepuppetlabs-cd4pe_jobs
module to the Puppetfile for each environment against which your compilers compile catalogs.There are multiple ways to Declare Forge modules in the Puppetfile. You can specify a specific version or specify
:latest
to automatically check for new versions. For example:mod 'puppetlabs-cd4pe', :latest # Requirements for cd4pe mod '<DEPENDENT_MODULE_NAME>', :latest mod 'puppetlabs-cd4pe_jobs', :latest
Make sure to declare all required modules, which includes thepuppetlabs-cd4pe
module, all of it's dependent modules, and thepuppetlabs-cd4pe_jobs
module.If you specify specific module versions in your Puppetfile, keep in mind that you must install version 1.6.0 or later of the
cd4pe_jobs
module to Add secrets to jobs. - If you configured Continuous Delivery to automatically deploy
code changes to the relevant environments, Continuous Delivery
deploys the updated code for you. If you have not configured automatic code
deployments, run
puppet code deploy <ENVIRONMENT>
to deploy the updated code to the relevant environments.
Update classification
Once puppetlabs-cdpe
and its dependencies are
deployed, you must update classification of your nodes.
- In the PE console, click Node groups (or Classification in PE versions prior to 2019.8.1) and open the PE Infrastructure group.
- Select the PE Master group and click Classes (or Configuration in PE versions prior to 2019.8.1).
- In the Add new class field, select
cd4pe::impact_analysis and click Add
class, then commit your change.
If you don't find cd4pe::impact_analysis in the class list, click Refresh to update class definitions.
- Run Puppet on the nodes in the PE
Master group.This Puppet run restarts the
pe-puppetserver
service. - Optional: You can adjust the maximum number of catalogs that Continuous Delivery is able to simultaneously compile, as explained in Optional impact analysis settings.