{% for ups in ups_devices %} [ups{{ loop.index }}] driver = {{ ups.driver }} port = {{ ups.port }} {% endfor %}