This commit is contained in:
parent
d22796053c
commit
262c03d359
14
states/tor/config.sls
Normal file
14
states/tor/config.sls
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
---
|
||||||
|
{%- from "tor/map.jinja" import tor with context %}
|
||||||
|
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
|
@ -1,29 +1,5 @@
|
|||||||
---
|
---
|
||||||
{%- from "tor/map.jinja" import tor with context %}
|
include:
|
||||||
tor-pkg:
|
- .install
|
||||||
pkg.latest:
|
- .config
|
||||||
- name: tor
|
- .service
|
||||||
|
|
||||||
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
|
|
||||||
|
5
states/tor/install.sls
Normal file
5
states/tor/install.sls
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
{%- from "tor/map.jinja" import tor with context %}
|
||||||
|
tor-pkg:
|
||||||
|
pkg.installed:
|
||||||
|
- name: tor
|
12
states/tor/service.sls
Normal file
12
states/tor/service.sls
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
---
|
||||||
|
{%- from "tor/map.jinja" import tor with context %}
|
||||||
|
tor-service:
|
||||||
|
{%- if tor.enabled %}
|
||||||
|
service.running:
|
||||||
|
{%- else %}
|
||||||
|
service.dead:
|
||||||
|
{%- endif %}
|
||||||
|
- name: tor
|
||||||
|
- enable: {{ tor.enabled }}
|
||||||
|
- require:
|
||||||
|
- pkg: tor-pkg
|
Loading…
Reference in New Issue
Block a user