Git integration

For scripts saved in Git repositories, Itential Automation Gateway (IAG) has a process to import those scripts from those various repositories.

“Git” refers to the use of GitHub, GitLab, Bitbucket, and other Git-based code integration/management tools.

Git in IAG

The primary Git tab is located in the left navigation menu of IAG. Alternatively, it is also listed under the Configuration tab.

Git configuration

Configure Git integration

From the Configuration tab, you can click Git to display the Git Integration Configuration modal, with configuration fields for Git Exec, Git Key Path, and Git Repo Path.

Strict Host Key Checking is an available option that will automatically check for a known host with an SSH key. If this option is checked, further manual action is required. You will need to check the server terminal to select “Yes” if the SSH key is a trusted key.

Git integration configuration

Create an SSH key

When you click the Git tab in the left navigation menu of IAG, a dropdown list for SSH Keys, Integrations, and Repositories displays.

Git menu list
1

Open the Create dialog

Click the ”+” in the top toolbar to open the Create dialog box. Scroll down and select Git SSH Keys.

Create an SSH key
2

Generate the key

Enter a name for the key under Generate SSH Key. Then click the Generate button.

Name the SSH key
3

View the generated key

An SSH key will be generated and a message banner displays in the upper right corner to confirm the SSH key pair was successfully generated. Click on SSH Keys in the left navigation bar. The newly generated key will display in the Public Key box with the name it was given. You will be able to view the SSH key and copy/paste it into Git.

View the SSH key

Add an SSH key

After creating the key, go to your Git CI/CD platform (e.g., GitLab) and access the appropriate section to set up your SSH Keys.

1

Paste the generated key

In GitLab, click Add an SSH Key and paste the generated key into the Key box provided.

Paste the SSH key
2

Add the key

Enter a key Title (name). Click Add Key. Both IAG and Git now have the same SSH key.

Making the key title the same name as the SSH key created in IAG will help identify what the key was created for.

Adding the SSH key

Create a Git integration

2

Create a new integration

Click the ”+” in the top toolbar to open a Create dialog box and then select Git Integration from the dropdown list.

Creating an integration
3

Name and configure the integration

Type in a name for the integration. Then select the name of the SSH key that was created from above. Click Create.

Naming the integration
4

Save changes

Click the name of the Git integration in the sidenav menu to display information pertaining to the integration and the SSH key being used. Click the search bar under SSH Key Name to display a dropdown list of names of any SSH keys that are stored. This allows you to change the integration to another key that has been created. Click Save at the bottom of the page to keep any changes.

Git integration information

Create a Git repository

1

Open the Create dialog

Click the ”+” in the top toolbar to open the Create dialog. Scroll down the list and select Git Repository and then click Create.

Creating a Git repository
2

Configure the repository

Select the integration that was created above and enter a name for this repository. Copy the SSH key from Git (i.e., use the Clone button in GitLab) and paste it into the Repository field. Next, choose the necessary code branch (in this case it is called “master”). This will be the location on the server where the repository is stored. In the example below, /opt/automation-gateway/repos/iag-repo/ is the location where the integration can be found. To clone and download the repository, click Create.

Naming the repository
3

View the repository

Click on the Repository tab in the left navigation menu and the repository name will be displayed. Click on the repository name to view information related to the repository. The Remote Fingerprint will display a unique identifier for the Host Key Check In. In the example below, multiple Host Keys have been added and are shown for the Host Key Check In.

Viewing the host key

Repository controls

In the footer (under the Remote Fingerprint), there are repository controls where you can Pull repo data, Reset repo data (if making any changes locally on the server — resetting will go back to the last commit), Delete data, or Reset the Fingerprint (this will remove the data shown under the Remote Fingerprint).

Repository controls

Import script configurations

1

Copy the file path

Copy the File Path from the repository that was created. For example: /opt/automation-gateway/repos/iag-repo/.

2

Configure the scripts path

Open the Scripts tab in the left side navigation. Paste the file path under Scripts Paths. Click the Save icon at the top. IAG will now be able to find all of the scripts in that directory.

Scripts path

Import decorations

Importing decoration scripts into the repo is an efficient way to save time without having to make edits to the decorations.

2

Pull from Git

When a Git Pull is done, the decoration pattern will be found using the file name (example: C_demo.scripts.iag.json). The parameters will be imported into IAG and saved to the database. Anytime there is a Git Pull from the repo, the decorations are saved into the database and can be located by their unique name attached to scripts.iag.json.

If the script, playbook, or module is not named with this exact suffix (e.g., name.type.iag.json), it will not be imported on a Git Pull.

File name

Collection modules are not supported and cannot be decorated automatically for a Git Pull.