Saltstack iterate through second level pillar data

Solution 1:

You need two levels of iteration. .iteritems() returns the key and the values (items) for that key. Your first iteration will give you access to option names and versions. Your second iteration will give you the display_name.

{% for option, versions in salt['pillar.get']('repo', {}).iteritems() %}
  {% for version, info in versions.iteritems() %}
    {{ version }}:{{ info['display_name'] }} 
  {% endfor %}
{% endfor %}

OR you could do this:

{% for option, versions in salt['pillar.get']('repo', {}).iteritems() %}
  {% for version in versions %}
    {{ version }}:{{ versions[version]['display_name'] }} 
  {% endfor %}
{% endfor %}