Walkthrough: Managing versions of component templates using Git



This topic walks you through the use of Git for version management of component templates . It includes the following sections:

The video at right demonstrates the various tasks involved in version management of component templates using Git.

Introduction

This topic is intended for system administrators or operators who are responsible for the creation, modification, and use of component templates in TrueSight Server Automation.

The goal of this topic is to use an integration with Git for version management tasks, such as keeping track of revisions, comparing revisions, or reverting to an earlier revision .

What does this walkthrough show?

This walkthrough shows how to use Git for version management of component templates, including the following tasks:

  • Committing revisions of a component template to the local repository.
  • Reviewing a history of revisions in a component template, including information regarding who made each change and when.
  • Comparing revisions of a component template.
  • Reverting to an earlier version of a component template.
  • Pushing all committed revisions of a component template to the remote Git repository.

What do I need to do before I get started?

Before you can manage versions of component templates, ensure that you have set up a local repository in the TrueSight Server Automation environment, as well as the remote Git repository. For more information about these setup tasks, see Setting-up-Git-repositories.

For this walkthrough, we have logged on as BLAdmin, the default superuser for BSA. 

How to commit changes to a component template

In this walkthrough, we will update a component template that is used by the Compliance officer to check for compliance with the DISA policy. Committing our changes into the Git repository will provide us with version control, which will help us preserve the template against errors that could potentially be introduced into the template over time.

Note

To perform the commit task through the BLCLI (as an alternative to the GUI method described here), you can use the ContentImportExport commitTemplate command. 


Step

Example screen

1

Under the Component Templates folder, navigate to the template that you want to edit, right-click it, and select Open.

openCT.png

2

Before making any changes in the component template, we will commit the template to the local Git repository for the first time. This first commit represents the out-of-box version of the template.

In the open component template, click the Git Repository History tab in the component template, and click the Commit button commitButton.png above the list of revisions (which is currently empty).

beforeCommitCT.png

3

In the Git Commit dialog box, adjust the email address and enter a summary message to accompany the commit.

Choose whether to include dependencies. In this example we will not include dependencies.

Afterwards, click Commit and then click OK in the informational message.

Commit details for the initial version of the component template are added on the Git Repository History tab.

commitCT.png

4

We will now modify a rule within the component template.

Click the Compliance tab. Then open one of the rules and modify it.

In this example, we will navigate to the rule for maximum password age, open it, and change the maximum password age from 60 days to 90 days.

After editing the compliance rule, click the Save button in the rule editor and close the rule. Then save the component template using the Save button in the toolbar.

chooseRule.png

AuditDisaTemplateComplianceRuleDef90.gif

5

Again, click the Git Repository History tab in the component template, and click the Commit button commitButton.png above the list. 

afterCommit1.png

 6

In the Git Commit dialog box, adjust the email address and enter a summary message to accompany the commit. In addition, clear the option to include dependencies.

Afterwards, click Commit and then click OK in the informational message.

Commit details for the new revision are added on the Git Repository History tab.

commitCT2.png

How to compare template revisions and revert to a previous revision

The list of changes in the component template contains already two entries. We will compare the two versions and revert to the earlier version of the template.


Step

Example screen

1

In the open component template, on the Git Repository History tab, review the various entries listed in the history of template changes.

Each entry provides commit details, including the commit message, the name of the user who made the change, and the date and time when the change was made.  

commitList.png

2

Select the two template revisions and click Compare compareButton.png.

compareCT.png

3

A comparison of the two versions of the template (in json format) appears on a new tab in the editor. The comparison opens directly to the first difference between the two versions. The newer version is on the left and the older version on the right.

To navigate to other differences, use the Next Change nextChange.png and Previous Change prevChange.png buttons above the compared text.

comparisonCT.png

4

After reviewing the differences, we have decided to revert to the original version of the template.

To revert, return to the open template, select the version of the template to which you want to revert, and click Get This Revision revertButton.png.

revertCT.png

5

In the confirmation message, click Yes.

revertCTconfirm.png

6

A new change entry is added to the template history. To finish reverting to the earlier version of the template, you must commit this change. Click Commit commitButton.png.

afterRevertCT.png

7

In the Git Commit dialog box, adjust the email address and enter a summary message to accompany the commit for the revert. In addition, clear the option to include dependencies.

Afterwards, click Commit and then click OK in the informational message.

revertCTcommit.png

8

Commit details are added for the new revision on the Git Repository History tab.

afterCTrevertAndCommit.png

How to push all changes to the remote Git repository

You must periodically push all changes stored in the local Git repository to the remote Git repository.

Note

To perform this task through the BLCLI (as an alternative to the GUI method described here), you can use the Git pushToRemote command.


Step

Example screen

1

In the console, click the Push button pushButton.png in the toolbar.


pushing2.png

2

The Git-Push-dialog-box displays information about all commits that will be pushed to the remote Git repository.

Click Push.

pushBox2.png

3

Click OK in the informational message.

pushSuccess.png

Wrapping it up

Congratulations! You have successfully performed version management on a component template.

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*