eda_projects.yml

In these files we configure the projects for eda controller.
we will probably do this on the global configuration (ALL), or on a per environment basis .

NOTE: It is wise to create EDA rulebook projects to contain the rule book together with the playbook it calls on the condition. This way you always have the two in one repository.
This way it is easier to debug when things go wrong.

When adding a project into the EDA controller, the same project must be added to the automation controller as wel.

group_vars/all/eda_projects.yml

Here we see an example of the configuration for an eda project.

---
eda_projects_all: []

...

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/eda_projects.yml

As we do not configure extra projects in development, this file is an empty set.

---
eda_projects_dev:

  - name: EDA_check_dev_webservice
    description: Check and repair the web servers for the DEV environment
    url: git@gitlab.homelab:eda_projects/web-check-repair.git
    scm_branch: dev
    tls_validation: true
    credential: EDA_gitlab
    organization: ORG_EDA

...

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

group_vars/prod/eda_projects.yml

As we do not configure extra projects in prod, this file is an empty set.

---
eda_projects_prod:

  - name: EDA_check_prod_webservice
    description: Check and repair the web servers for the Production environment
    url: git@gitlab.homelab:eda_projects/web-check-repair.git
    scm_branch: master
    tls_validation: true
    credential: EDA_gitlab
    organization: ORG_EDA

...

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: - eda_projects_all
- eda_projects_

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

The rusult in the development environment will be that both projects are configured and in production, there will be only one.

The project used here, can be found here:
EDA_example_project

Back