Shared configurations

Operations Center provides a facility to replicate a subset of system configuration information (configuration snippet) to Client Masters.

This feature requires the following (or newer) versions of plugins installed in Operations Center to work:

  • Operations Center Context 1.6.3

  • Operations Center Server 1.6.8

  • Operations Center RBAC 1.6.2

Additionally, each Client Master requires Operations Center Context 1.6.3 or newer to receive the configuration.

Creating a configuration snippet replicates that configuration to any Client Masters within the same folder hierarchy that have not opted out of receiving shared configuration. This feature is ideal when you have some configuration such as Alerting or E-mail configuration that should be kept in sync on one (or more) Client Masters. It is possible to define multiple shared configuration within the same folder as well in any parent folder and the configuration of all of these will be replicated to the Client Master.

Creating a shared configuration

To create a shared configuration, review the following:

It is first important to work out which of your Client Masters you wish to receive the shared configuration so that you can identify the correct folder(s) to create the shared configuration in.

For example, if you have six Client Masters (A,B,C,D,E, and F) and you wish five (A,B,C,D and E) of them to have the same e-mail configuration (for example: SMTP server or Jenkins instance e-mail)yet only three of the Client Masters (C,D and E) to have the alerting information you will need to create one item to contain the e-mail configuration that is in a folder that is the parent of all of the Client Masters, and one item to hold the Alerting information that is in a folder that contains or is a parent of only C, D and E.

Root
 + Folder One
 |   \
 |    + {CM} A
 |    + {CM} B
 |    + Folder Two
 |      \
 |       + {CM} C
 |       - {CM} D
 |       - {CM} E
 |
 - {CM} F

In the above hierarchy, the Alerting configuration is created in Folder Two and the e-mail configuration is created in Folder One.

To obtain the correct hierarchy, you may have to move the Client Masters to different folders.
  1. Once you have identified the correct location for the Shared Configuration, navigate to that folder and choose New Item, provide a name for the configuration, select the type Miscellaneous Configuration Container and then OK.

    new screen

    The subsequent screen allows you to define the type of configuration snippet.

  2. By selecting Add Snippet and choosing the type of configuration you want to add, you can enter the configuration of the item to replicate. A list of supported snippets is available below.

add snippet screen

Each snippet is configured as it would be in the main Jenkins Configure System page.

As Jenkins consolidates the configuration in the current folder with the configuration in the parent folders, it is important to know the piece of information within each snippet is the key such that configuration can be overwritten in a child folder. This is done to prevent entering the same key twice by accident. In all cases, when a snippet with the same key is defined in multiple places the one in the folder closest to the folder containing the Client Master takes precedence.

Table 1. Supported snippet types and their key attribute
Snippet Type Key Attribute Inheritance Behavior

Alerts

Alert title

Snippets with different keys are combined into the configuration.

E-Mail Notification

N/A

As there can be only one email configuration the closest to the Client Master takes precedence, and others are ignored.

System message

N/A

As there can be only one system message, the closest to the master takes precedence.

Tool Installation

Tool Name

Snippets with different keys are combined into the configuration.

If multiple snippets are are defined with the same key in the same Miscellaneous configuration container, or in a different Miscellaneous configuration container within the same Folder — then the snippet used is non-deterministic and, as such, should be avoided.

Understanding snippet types

Using tool installation

The Tool Installation mechanism allows you to specify tool setup procedures in global configurations and then use them in Jenkins jobs. Various Tool Installation types are provided by Jenkins core and plugins: JDK, Maven, Git, and Docker CLI. Large-scale distributed installations may include dozens of complex tool configurations, hence it is recommended to store them in Operations Center using this snippet.

Configuring tool installation

Each Tool Installation snippet defines one installation of a tool. It is possible to setup multiple Tool Installations. To do this, do the following:

  1. Create a new Tool Installation snippet.

  2. Select a tool type to snippet.

  3. Configure the tool according to the guidelines available in the built-in help on on plugin Wiki pages.

    • Installation names should be unique within one tool type

    • It is possible to set up multiple tool installers for different node labels

snippets tool installer select snippet
Figure 1. Step 1. Selecting the snippet
snippets tool installer select tool
Figure 2. Step 2. Selecting tool to be installed
snippets tool installer config
Figure 3. Step 3. Setting up a tool (JDK from Jenkins Core)
Understanding behavior specifics

The following define function behaviors when using Tool Installer:

Feature Description

Missing Plugins

When a tool is configured in the Miscellaneous Configuration Container or any part of its configuration (for example: Tool Installer) come from a plugin not installed on a Client Master, the configuration for that specific tool won’t be propagated to that Client Master. If the missing plugin is installed on the attached Client Master, a reconnection of the Client Master is required in order to make the Tool Installation be propagated to the Client Master.

Form Verification

Tool Installation or Tool Installer configuration forms may provide verification for the configuration entries or contain check buttons (for example: Test Connection). In the case of the Shared Configuration Snippet, all these verification handlers will be launched on the Operations Center instance instead of the Client Masters. It means that the verification result may be false-positive or false-negative, because Operations Center and Client Master environments may differ.

It is highly recommended to double-check tool configurations on Operations Center and on Client Masters after making changes.

Reviewing tested tools

The Tool Installation Snippet has been tested with the following tools:

A correct behavior for other Tool Installation types is not guaranteed. If you see any issues with the configuration propagation, please contact the CloudBees Support team.

Configuring tool installation for plugin developers

If your plugins provide their own Tool Installation types, these types automatically appear in the dropdown list. Due to the specifics of the Tool Installation extension point in the Jenkins core, it’s not guaranteed that the configuration form displays properly. Missing or duplicated ToolInstallationProperty entries is one of known issues.

To make your Tool Installation compatible with the configuration snippet, follow examples in Jenkins JDK Tool. Tool Installation snippets for such implementations should work correctly out-of-the-box.

Opting a Client Master out of shared configuration

In some cases, you may want a specific Client Master to not receive any shared configuration. To do this, opt out of the Client Master from shared configuration.

To do this, do the following:

Configure the Client Master and choose Disable under the Shared Configuration section.

client master optout
If shared configuration is not disabled, then the same section provides information about the Client Master’s ability to support this feature.
client master support

Opting Operations Center into shared configuration

It may be useful to opt Operations Center into the Shared Configuration. For example, where you are customizing tool installer locations on shared agents you will need those tool installers to be configured in Operations Center in order to be able to define the location overrides. Additional use cases include:

  • Configuring common alerts

  • Ensuring the email notification settings are consistently applied across the entire cluster

  • Applying a system message to the entire cluster

If you opt-in Operations Center it will pick up any Shared Configurations defined in the root of Operations Center.

To enable Operations Center to consume the shared configuration you must enable the Shared Configuration option from the Operations Center global configuration.

global config quick jump
Figure 4. Using the global configuration’s "Quick-Jump" navigation to find the Shared Configuration option
global config enabled
Figure 5. Enable consume shared configuration