1. CI/CD For IaC function

1.1. Introdction

This document aims to explain how to use the CI/CD for IaC function.

1.2. Terminology

The terminology used in this document is as following.
表 1.124 Terminology list

Terminology | Contents

ITA

Abbreviation for "Exastro IT Automation".

Link source file |Displays the files within the git repository
linked with the CI/CD for IaC function
Link destination file | The user can upload files
from the following menus found
in the "Ansible-Driver", "Terraform-Cloud/EP-Driver"
and "Terraform-CLI-Driver" menus.

- Ansible-Legacy/Playbook file collection

- Ansible-Pioneer/Interactive file collection

- Ansible-LegacyRole/Role package management

- Ansible common/ file management

- Ansible common/ template management

- Terraform-Cloud-EP/Module file collection

- Terraform-Cloud-EP/Policy management

- Terraform-CLI/Module file collection

1.3. CI/CD For IaC function overview

1.3.1. Function overview

The CI/CD for IaC function is mainly divided into 2 functions.
  1. Git link function
    This function clones the Git repository within ITA.
    It then uses the clone to periodicaly check for changes in the link source files and displays them in a list in the ITA "Remote repository file" menu.
  2. File link function
    Creates a link between the source and destination files and registers an Operation and a movement for verifying the files.
    If the link source files are updated, the link destination files will automatically be updated and the previously created verifying movement and operation will be executed.

1.3.2. Function overview diagram

The CI/CD For IaC function's overview diagram is as following.
../../_images/CICD_overviews.png

1.4. CI/CD For IaC function menu structure

This section explains the CI/CD function's menu structure

1.5. CI/CD For IaC function guide

This section explains how to use the CI/CD For IaC function.

1.5.1. Operation flow

A standard operation flow for the CI/CD For IaC function is as following.
A more detailed description regarding each of the steps are written below.
../../_images/CICD_flow.png

Operation flow details and references

  1. Register remote repository
    Register the link Git repository information.
    For more information, see the "Remote repository" menu.
  2. Register file link
    Register a link between the source and destination files.
    For more information, see the "File link" menu.
  3. Register operation and movement to file link
    Register an operation and movement for veryfying updated link destination files.
    For more information, see the "File link" menu.
  4. Automatically check file update and function validation.
    Check that the Link destination files are automatically updated when the link source files are update.
    The user must also check that the movement and operation are automatically executed if they are registered.
    For more information, see the "File link" menu.

1.6. CI/CD For IaC function menu operation

This section explains how to operate the CI/CD For IaC menu.

1.6.1. CI/CD For IaC menu

This section describes how to operate the menus displayed when the CI/CD For IaC function is installed.

Remote repository

  1. The "Remote repository" menu allows users to register information for the linking Git repository.
Submenu page(remote repositoru)

図 1.93 Submenu page(remote repository)

  1. The input items in the Remote repository page are as following.
  2. The items displaying the synchronization status of the remote repository are as following.
    表 1.125 Remote repository page Synchronization status display items

    Item

    Description

    Remarks

    Status

    The Git repository synchronization status displays one of the following statuses.
    Blank: Status when a record is newly registered, updated or restored.
    Success: Status when synchronization with Git repository was successful.
    Error: Status when synchronization with Git repository failed.
    Re-open: Status when the Re-open button was clicked.
    If the status changes to Error, the Git repository synchronization will stop.
    In order to re-open it, click the Re-open button or update the corresponding record.

    Detailed information

    If the status changes to Error, the error log will be displayed.
    Click the Re-open button or update the corresponding record to clear the detailed information.

    Last updated date/time

    Displays the last date/time the Git repository was synchronized.
    Click the Re-open button or update the corresponding record to clear the Last updated date/time.

    Re-open button

    Re-activates records with an Error status.
    Clicking the Re-open button changes the status to "Re-open".

1.6.2. CI/CD For IaC hidden menus

This section explains how to operate CI/CD for IaC menus that are hidden by default.
In order to access the different menus, access "Management console/Role/Menu link management" menu and restore the corresponding menus. This will un-hide the menus and make them accessible.

Remote repository files

  1. This menu displays all linked source files.
    The information displayed is updated by an internal function.
    We highly recommend against adding, updating and deleting records in this menu.
Submenu page (Remote repository files)

図 1.95 Submenu page (Remote repository files)

  1. The items found in the Remote repository file menu are as following.

1.7. Appendix

1.7.1. Notes regarding registering files to Git repositories.

Make sure to read the following points when registering files to Git repositories.
  1. Registering Git repositories with file names exceeding 256 to the "Remote repository" menu will cause the Git clone command to end in an error.
  2. Registering Git repositories with file paths and file names exceeding 4096 bytes combined to the "Remote repository" menu will cause the Git clone command to end in an error.

1.7.2. Notes regarding registering files that are linked with the Role package management to Git repositories.

Make sure to read the following points when registering files linked with the "Ansible-LegacyRole/Role package management" to Git repositories.
  1. Create a directory that contains a directory with the name "roles" and put all the files and directories required by the Role package function in there.
    Files compressed as Role packages are put under in the upper directory of the "roles" directory. However, creating a directory called "roles" directory under the Git repository route directory will not work, as it will not be recognized as such by the "Ansible-LegacyRole/Role package list" menu.
    Directories configured like the one in the example below will have its "sample/roles" recognized as a role directory. HOwever, the "roles" directory will not be recognized.
    Git repository route directory
    リスト 1.25 Git repository route directory
    |-  roles          ・・・・・・・Not recognized as roles directory.
    |   |  ita_readme_test_role.yml
    |   |- test_role
    |      |-  defaults
    |      |     main.yml
    |      |-  tasks
    |            main.yml
    |
    |- sample
        | ita_readme_test_role.yml
        |- roles       ・・・・・・・Recognized as roles directory.
            |- test_role
               |- defaults
               |     main.yml
               |- tasks
                     main.yml
    
The "sample/roles" displayed in the File link"menu's file path. Select "sample/roles" for file paths linking to the "Ansible-LegacyRole/Role package management" menu.
sample_role