controller_hosts.yml.j2 template

---
{% set curr_env=curr_file.split(',')[0] %}
{% if code_environment_vars[curr_env]['hosts'] | length > 0  %}
controller_hosts_{{ curr_env }}:
  {% for item in code_environment_vars[curr_env]['hosts'] %}
  - name: {{ item.name }}
    description: {{ item.description }}
    organization: {{ organization_long_name }}
  {% endfor %}
{% else %}
controller_hosts_{{ curr_env }}: []
{% endif %}
...

Back