eda_decision_environments.yml
In these files we configure the decision environments for eda controller.
NOTE
we will not do this on a global level as we did with the execution environments, as the EDA configuration requires a decision environment to be organization specific.
As the decision environment requires a credential from the same organization as the decision environment, we will configure this from the organization configuration.
group_vars/all/eda_decision_environments.yml
Here we see an example of the configuration for a decision environment to pull this image from a registry.
---
eda_decision_environments_all:
- name: my_default_de
description: my default decision environment
image_url: "image_registry.example.com/default-de:latest"
credential: my_credential
organization: Default
...
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_decision_environments.yml
As we do not configure extra decision_environments in development, this file is an empty set.
---
eda_decision_environments_dev: []
# No extra config exists
...
Here the variable has the "_dev" extension, so the variable will not be overridden.
group_vars/prod/eda_decision_environments.yml
As we do not configure extra decision_environments in prod, this file is an empty set.
---
eda_decision_environments_prod: []
# No extra config exists
...
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_decision_environments_all
- eda_decision_environments_
We will merge these 2 variables into 1: eda_decision_environments and feed this to the infra.aap_configuration.eda_decision_environments role.
In main.yml the merge of the variables is done by this piece of code:
- name: Set the controller vars
ansible.builtin.set_fact:
controller_decision_environments: >
{{ controller_decision_environments_all |
community.general.lists_mergeby(vars['controller_decision_environments_' + branch_name],
'name', recursive=true, list_merge='append') }}
This results in the controller_decision_environments variable the collection needs.