paulbsd-salt/states/tor/init.sls

29 lines
519 B
Plaintext
Raw Normal View History

2020-07-10 00:58:55 +02:00
---
{%- 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