#jinja2: trim_blocks: True, lstrip_blocks: True {% for vm in vm.hosts %} {% set vm = hostvars[vm] %} vm "{{ vm.ansible_host }}" { {% if vm.enabled %} enable {% else %} disable {% endif %} memory {{ vm.memory }} disk "{{ vmm.disk.dir }}/{{ vm.ansible_host }}.{{ vmm.disk.format }}" interface { switch "{{ vmm.config.switch.name }}" } } {% endfor %} switch "{{ vmm.config.switch.name }}" { interface {{ vmm.config.switch.interface }} }