updated tor state
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Paul 2022-12-26 10:15:34 +01:00
parent d22796053c
commit 262c03d359
4 changed files with 35 additions and 28 deletions

14
states/tor/config.sls Normal file
View 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

View File

@ -1,29 +1,5 @@
---
{%- 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
include:
- .install
- .config
- .service

5
states/tor/install.sls Normal file
View 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
View 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