--- {%- from "zabbix/map.jinja" import zabbix with context %} zabbix-script-dir: file.directory: - name: /etc/zabbix/scripts - user: {{ zabbix.agent2.user }} - group: {{ zabbix.agent2.group }} - watch_in: - service: zabbix-agent2-service {% for key, value in zabbix.agent2.scripts.items() -%} zabbix-script-{{ key }}: file.managed: - name: /etc/zabbix/scripts/{{ value.name }} - source: salt://zabbix/scripts/{{ value.name }} - user: {{ zabbix.agent2.user }} - group: {{ zabbix.agent2.group }} - mode: 0755 - watch_in: - service: zabbix-agent2-service {% endfor -%}