- 20 Dec 2024
-
DarkLight
-
PDF
Step 3: Connecting a Git Repository to IAG5
- Updated on 20 Dec 2024
-
DarkLight
-
PDF
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
- For demonstration purposes, you can use
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
- You will be prompted for an initial password. On first login, that password is always
admin
. Typeadmin
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: