controller_projects.yml

In these files we configure the projects for automation controller.
we will probably do this on each environment separately, as the hostnames differ.

variables

The api definition of possible values is listed below:

{
    "name": "",
    "description": "",
    "local_path": "",
    "scm_type": "",
    "scm_url": "",
    "scm_branch": "",
    "scm_refspec": "",
    "scm_clean": false,
    "scm_track_submodules": false,
    "scm_delete_on_update": false,
    "credential": null,
    "timeout": 0,
    "organization": null,
    "scm_update_on_launch": false,
    "scm_update_cache_timeout": 0,
    "allow_override": false,
    "default_environment": null,
    "signature_validation_credential": null
}

group_vars/all/controller_projects.yml

Here we configure only recovery scenarios in the base configuration, so we can restore eveything after initial configuration.

---
controller_projects_all:

  - name: MGT_recover_aap_organizations
    description: Trigger all CaC repositories
    organization: MGT
    scm_type: git
    scm_url: git@gitlab.homelab:CaC/recover_aap_organizations.git
    scm_credential: gitlab
    scm_branch: master
    scm_clean: false
    scm_delete_on_update: false
    scm_update_on_launch: true
    scm_update_cache_timeout: 0
    allow_override: false
    timeout: 0

  - name: MGT_config_ahub
    description: Trigger configuration of Automation hub
    organization: MGT
    scm_type: git
    scm_url: git@gitlab.homelab:CaC/config_ahub.git
    scm_credential: gitlab
    scm_branch: master
    scm_clean: false
    scm_delete_on_update: false
    scm_update_on_launch: true
    scm_update_cache_timeout: 0
    allow_override: false
    timeout: 0
...

But you can already see that the variable name used here has the "_all" extension, so the variable will not be overridden as this is not quite a inventory.
Why we do this, will become clear in a moment.

group_vars/dev/controller_projects.yml

We configure some extra projects in development, but these are inventory projects with base variables for constructed inventories we use.

---
controller_projects_dev:

  - name: MGT_inventory_spec
    description: Spec inventory project
    organization: MGT
    scm_type: git
    scm_url: git@gitlab.homelab:container_aap/inventory_mgt.git
    scm_credential: MGT_gitlab
    scm_branch: dev
    scm_clean: false
    scm_delete_on_update: false
    scm_update_on_launch: true
    scm_update_cache_timeout: 0
    allow_override: false
    timeout: 0

  - name: MGT_inventory_base
    description: inventory project
    organization: MGT
    scm_type: git
    scm_url: git@gitlab.homelab:container_aap/inventory_base.git
    scm_credential: MGT_gitlab
    scm_branch: dev
    scm_clean: false
    scm_delete_on_update: false
    scm_update_on_launch: true
    scm_update_cache_timeout: 0
    allow_override: false
    timeout: 0
...

Here the variable has the "_dev" extension, so the variable will not be overridden.

group_vars/prod/controller_projects.yml

We configure some extra projects in production, but these are inventory projects with base variables for constructed inventories we use.

---
controller_projects_prod:

  - name: MGT_inventory_spec
    description: Spec inventory project
    organization: MGT
    scm_type: git
    scm_url: git@gitlab.homelab:container_aap/inventory_mgt.git
    scm_credential: MGT_gitlab
    scm_branch: prod
    scm_clean: false
    scm_delete_on_update: false
    scm_update_on_launch: true
    scm_update_cache_timeout: 0
    allow_override: false
    timeout: 0

  - name: MGT_inventory_base
    description: inventory project
    organization: MGT
    scm_type: git
    scm_url: git@gitlab.homelab:container_aap/inventory_base.git
    scm_credential: MGT_gitlab
    scm_branch: prod
    scm_clean: false
    scm_delete_on_update: false
    scm_update_on_launch: true
    scm_update_cache_timeout: 0
    allow_override: false
    timeout: 0
...

Here the variable has the "_prod" extension, so the variable will not be overridden.

When we run a pipeline for a certain environment, the inventory structure will provide us with 2 variables: - controller_projects_all
- controller_projects_

We will merge these 2 variables into 1: controller_projects and feed this to the infra.aap_configuration.controller_projects role.

Back