Compare commits
2 Commits
cfd90bc713
...
47b7049314
Author | SHA1 | Date | |
---|---|---|---|
47b7049314 | |||
f281f7c30a |
13
README.rst
13
README.rst
@ -1,8 +1,8 @@
|
||||
================
|
||||
salt-tor-formula
|
||||
tor-formula
|
||||
================
|
||||
|
||||
Simple Salt formula to install tor relay on debian.
|
||||
Simple Salt formula to install and configure Tor on Debian and SUSE based distributions.
|
||||
|
||||
.. note::
|
||||
|
||||
@ -18,10 +18,15 @@ Available states
|
||||
``tor``
|
||||
-----------------------
|
||||
|
||||
Install packets and setup config files.
|
||||
Install and configure Tor.
|
||||
|
||||
``tor.install``
|
||||
-------------------------------
|
||||
|
||||
Only install packets.
|
||||
Only install Tor packages.
|
||||
|
||||
``tor.torsocks``
|
||||
-------------------------------
|
||||
|
||||
Install and configure torsocks.
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
{% from "tor/map.jinja" import map with context %}
|
||||
{% from "tor/map.jinja" import map, osfamily with context %}
|
||||
|
||||
include:
|
||||
{%- if osfamily == 'Debian' %}
|
||||
|
@ -1,4 +1,4 @@
|
||||
{% from "tor/map.jinja" import map with context %}
|
||||
{% from "tor/map.jinja" import map, osfamily with context %}
|
||||
|
||||
{%- if osfamily == 'Debian' %}
|
||||
include:
|
||||
|
@ -1,5 +1,6 @@
|
||||
{% 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,
|
||||
|
||||
|
@ -10,5 +10,6 @@ Suse:
|
||||
pkgs:
|
||||
- tor
|
||||
service: tor
|
||||
service_torsocks: torsocks
|
||||
config_file: '/etc/tor/torrc'
|
||||
config_torsocks: '/etc/tor/torsocks.conf'
|
||||
|
@ -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:
|
||||
file.managed:
|
||||
@ -11,9 +23,17 @@ 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 %}
|
||||
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user