--- {%- from "tor/map.jinja" import tor with context %} tor-pkg: pkg.latest: - name: tor tor-config: file.managed: - name: /etc/tor/torrc - source: salt://tor/torrc.j2 - user: root - group: root - mode: "0660" - template: jinja - watch_in: - service: tor-service - require: - pkg: tor-pkg tor-service: {%- if tor.enabled %} service.running: {%- else %} service.dead: {%- endif %} - name: tor - enable: {{ tor.enabled }} - require: - pkg: tor-pkg