controller_inventory_sources.yml.j2 template

---
{% set curr_env=curr_file.split(',')[0] %}
{% if code_environment_vars[curr_env]['inventory_sources'] | length > 0  %}
controller_inventory_sources_{{ curr_env }}:
  {% for item in code_environment_vars[curr_env]['inventory_sources'] %}
  - name: {{ item.name }}
    description: {{ item.description }}
    organization: {{ organization_long_name | upper }}
    source: scm
    source_project: {{ organization_short_name | upper }}_demo_inventory
    source_path: hosts.ini
    source_vars: '{}'
    inventory: {{ organization_short_name | upper }}_demo_inventory
    update_on_launch: true
    overwrite: true
  {% endfor %}
{% else %}
controller_inventory_sources_{{ curr_env }}: []
{% endif %}

...

Back