Step 3: Connecting a Git Repository to IAG5
  • 20 Dec 2024
  • Dark
    Light
  • PDF

Step 3: Connecting a Git Repository to IAG5

  • Dark
    Light
  • PDF

Article summary

IAG5 requires a Git repository to obtain the script to be used in a service.

Objective: Onboard automation script(s) from a Git repo so they can be managed and executed as services.
Time required: 2-3 minutes

Prerequisites

You will need the following to complete this guide:

  • An IAG5 server that is successfully conected to Itential Cloud
  • An existing Git repository (github, gitlab), either:
    • For demonstration purposes, you can use https://github.com/torerodev/example-scripts, or
    • Your own Github or Gitlab repository that contains your automation scripts

1. Set IAG5 Server to 'Client' Mode

IAG5 must be in client mode to connect a new Git repository. Read more about IAG5 application modes here.

Set the GATEWAY_APPLICATION_MODE environment variable as follows:

export GATEWAY_APPLICATION_MODE=client



Login as admin user

/opt/gateway/iagctl login admin


If this is the first time logging into IAG5 as a client, you will need to set the admin password
  • You will be prompted for an initial password. On first login, that password is always admin. Type admin and press Enter.
  • You will then be prompted for a new password. Enter a secure password longer than 8 characters that will be used for your admin accounts and follow the rest of the prompts. You will now be logged in. You can exit the console.


2. Connect to a Git repository

For this guide, we will use a simple example of a repository that is publically accessible and requires no authentication. Additional instructions can be found here to connect private repositories, connect to specific branches, or connecting to repositories with authentication.

Connect repository to IAG5 using the iagctl create respository command

iagctl create repository example-scripts-repo --description "Simple repository for tutorial" --url https://github.com/torerodev/example-scripts.git --reference main


You will see this output to confirm that the repository was created.

Output:

Successfully created the repository

Name:             example-scripts-repo
Description:      Simple repository for tutorial
Url:              https://github.com/torerodev/example-scripts.git
Reference:        main
Tags:             
Private Key Name:

Was this article helpful?

Changing your password will log you out immediately. Use the new password to log back in.
First name must have atleast 2 characters. Numbers and special characters are not allowed.
Last name must have atleast 1 characters. Numbers and special characters are not allowed.
Enter a valid email
Enter a valid password
Your profile has been successfully updated.