{%- for hostname, switch in pillar['switches'].items() %} /root/{{ hostname }}.expect: file.managed: - source: salt://switches/{{ switch['model'] }}.expect - template: 'jinja' - context: hostname: {{ hostname }} switch: {{ switch }} logging: {{ pillar['hosts-inet']['mgmt']['logging'] }} - mode: 755 {%- endfor %}