Torsocks for SUSE logic

Signed-off-by: Georg Pfuetzenreuter <mail@georg-pfuetzenreuter.net>
This commit is contained in:
Georg Pfuetzenreuter 2023-02-05 18:25:17 +01:00
parent 500cc24176
commit f281f7c30a
Signed by: Georg
GPG Key ID: 1ED2F138E7E6FF57
5 changed files with 31 additions and 4 deletions

View File

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

View File

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

View File

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

View File

@ -6,4 +6,10 @@ Debian:
config_torsocks: '/etc/tor/torsocks.conf' config_torsocks: '/etc/tor/torsocks.conf'
https_support_pkg: apt-transport-https https_support_pkg: apt-transport-https
Suse:
pkgs:
- tor
service: tor
service_torsocks: torsocks
config_file: '/etc/tor/torrc'
config_torsocks: '/etc/tor/torsocks.conf'

View File

@ -1,4 +1,16 @@
{% from "tor/map.jinja" import map with context %} {% 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 %}
deploy_tor_torsocks: deploy_tor_torsocks:
file.managed: file.managed:
@ -11,9 +23,17 @@ deploy_tor_torsocks:
- defaults: - defaults:
config: {{ map.torsocks }} config: {{ map.torsocks }}
- require: - require:
{%- if osfamily == 'Suse' %}
- pkg: install_torsocks
{%- else %}
- pkg: install_tor - pkg: install_tor
{%- endif %}
- watch_in: - watch_in:
{%- if osfamily == 'Suse' %}
- service: install_torsocks
{%- else %}
- service: install_tor - service: install_tor
{%- endif %}