Compare commits

..

1 Commits

Author SHA1 Message Date
cfd90bc713
Add OS map for SUSE
Signed-off-by: Georg Pfuetzenreuter <mail@georg-pfuetzenreuter.net>
2023-02-05 18:25:17 +01:00
6 changed files with 7 additions and 34 deletions

View File

@ -1,8 +1,8 @@
================
tor-formula
salt-tor-formula
================
Simple Salt formula to install and configure Tor on Debian and SUSE based distributions.
Simple Salt formula to install tor relay on debian.
.. note::
@ -18,15 +18,10 @@ Available states
``tor``
-----------------------
Install and configure Tor.
Install packets and setup config files.
``tor.install``
-------------------------------
Only install Tor packages.
``tor.torsocks``
-------------------------------
Install and configure torsocks.
Only install packets.

View File

@ -1,4 +1,4 @@
{% from "tor/map.jinja" import map, osfamily with context %}
{% from "tor/map.jinja" import map with context %}
include:
{%- if osfamily == 'Debian' %}

View File

@ -1,4 +1,4 @@
{% from "tor/map.jinja" import map, osfamily with context %}
{% from "tor/map.jinja" import map with context %}
{%- if osfamily == 'Debian' %}
include:

View File

@ -1,6 +1,5 @@
{% import_yaml "tor/defaults.yaml" as defaults %}
{% import_yaml "tor/osfamilymap.yaml" as osfamilymap %}
{% set osfamily = salt['grains.get']('os_family', False) %}
{% set map = salt['grains.filter_by'](defaults,

View File

@ -10,6 +10,5 @@ Suse:
pkgs:
- tor
service: tor
service_torsocks: torsocks
config_file: '/etc/tor/torrc'
config_torsocks: '/etc/tor/torsocks.conf'

View File

@ -1,16 +1,4 @@
{% from "tor/map.jinja" import map, osfamily with context %}
{%- if osfamily == 'Suse' %}
install_torsocks:
pkg.installed:
- name: torsocks
service.running:
- name: {{ map.service_torsocks }}
- restart: True
- enable: True
- require:
- pkg: install_torsocks
{%- endif %}
{% from "tor/map.jinja" import map with context %}
deploy_tor_torsocks:
file.managed:
@ -23,17 +11,9 @@ deploy_tor_torsocks:
- defaults:
config: {{ map.torsocks }}
- require:
{%- if osfamily == 'Suse' %}
- pkg: install_torsocks
{%- else %}
- pkg: install_tor
{%- endif %}
- watch_in:
{%- if osfamily == 'Suse' %}
- service: install_torsocks
{%- else %}
- service: install_tor
{%- endif %}