--- {%- from "haproxy/map.jinja" import haproxy with context %} haproxy-pkg: pkg.installed: - pkgs: {{ haproxy.packages }} haproxy-maps-dir: file.directory: - name: {{ haproxy.config.dir }}/maps - user: {{ haproxy.config.user }} - group: {{ haproxy.config.group }} - mode: "0700" haproxy-script-dir: file.directory: - name: {{ haproxy.config.dir }}/scripts - user: {{ haproxy.config.user }} - group: {{ haproxy.config.group }} - mode: "0700" {% for file in haproxy.scripts %} haproxy-script-{{ file.name }}: file.managed: - name: {{ haproxy.config.dir }}/{{ file.name }} - source: salt://haproxy/{{ file.name }} - user: {{ haproxy.config.user }} - group: {{ haproxy.config.group }} - mode: "0700" - watch_in: - service: haproxy-service {% endfor %} {% for filename in haproxy.maps %} haproxy-maps-{{ filename }}: file.managed: - name: {{ haproxy.config.dir }}/maps/{{ filename }} - source: salt://haproxy/templates/{{ filename }}.j2 - user: {{ haproxy.config.user }} - group: {{ haproxy.config.group }} - mode: "0600" - template: jinja - watch_in: - service: haproxy-service {% endfor %}