diff --git a/tor/config.sls b/tor/config.sls index c18baf5..133e901 100644 --- a/tor/config.sls +++ b/tor/config.sls @@ -1,4 +1,4 @@ -{% from "tor/map.jinja" import map with context %} +{%- from "tor/map.jinja" import map with context -%} include: - tor.install @@ -18,8 +18,7 @@ deploy_tor_torrc: - watch_in: - service: install_tor -{% if salt['pillar.get']('tor:ed25519_signing_cert', False) %} - +{%- if salt['pillar.get']('tor:ed25519_signing_cert', False) %} deploy_tor_signing_cert: file.decode: - name: {{ map.torrc.DataDirectory }}/keys/ed25519_signing_cert @@ -39,12 +38,9 @@ set_owner_tor_signing_cert: - file: deploy_tor_signing_cert - watch_in: - service: install_tor +{%- endif %} -{% endif %} - - -{% if salt['pillar.get']('tor:ed25519_signing_secret_key', False) %} - +{%- if salt['pillar.get']('tor:ed25519_signing_secret_key', False) %} deploy_tor_signing_secret_key: file.decode: - name: {{ map.torrc.DataDirectory }}/keys/ed25519_signing_secret_key @@ -64,12 +60,9 @@ set_owner_tor_signing_secret_key: - file: deploy_tor_signing_secret_key - watch_in: - service: install_tor +{%- endif %} -{% endif %} - - -{% if salt['pillar.get']('tor:ed25519_master_id_secret_key', False) %} - +{%- if salt['pillar.get']('tor:ed25519_master_id_secret_key', False) %} deploy_tor_master_id_secret_key: file.decode: - name: {{ map.torrc.DataDirectory }}/keys/ed25519_master_id_secret_key @@ -89,13 +82,9 @@ set_owner_tor_master_id_secret_key: - file: deploy_tor_master_id_secret_key - watch_in: - service: install_tor +{%- endif %} -{% endif %} - - - -{% if salt['pillar.get']('tor:ed25519_master_id_public_key', False) %} - +{%- if salt['pillar.get']('tor:ed25519_master_id_public_key', False) %} deploy_tor_master_id_public_key: file.decode: - name: {{ map.torrc.DataDirectory }}/keys/ed25519_master_id_public_key @@ -115,12 +104,9 @@ set_owner_tor_master_id_public_key: - file: deploy_tor_master_id_public_key - watch_in: - service: install_tor +{%- endif %} -{% endif %} - - - -{% if salt['pillar.get']('tor:secret_id_key', False) %} +{%- if salt['pillar.get']('tor:secret_id_key', False) %} deploy_tor_secret_id_key: file.managed: - name: {{ map.torrc.DataDirectory }}/keys/secret_id_key @@ -132,11 +118,9 @@ deploy_tor_secret_id_key: - file: deploy_tor_torrc - watch_in: - service: install_tor -{% endif %} +{%- endif %} - - -{% if salt['pillar.get']('tor:fingerprint', False) %} +{%- if salt['pillar.get']('tor:fingerprint', False) %} deploy_tor_fingerprint: file.managed: - name: {{ map.torrc.DataDirectory }}/fingerprint @@ -148,6 +132,4 @@ deploy_tor_fingerprint: - file: deploy_tor_torrc - watch_in: - service: install_tor -{% endif %} - - +{%- endif %} diff --git a/tor/defaults.yaml b/tor/defaults.yaml index 5afa690..6e4cb11 100644 --- a/tor/defaults.yaml +++ b/tor/defaults.yaml @@ -4,7 +4,6 @@ tor: service: tor config_torrc: '/etc/tor/torrc' config_torsocks: '/etc/tor/torsocks.conf' - fingerprint: False torrc: DataDirectory: '/var/lib/tor' diff --git a/tor/init.sls b/tor/init.sls index 103a9e1..02b3c5e 100644 --- a/tor/init.sls +++ b/tor/init.sls @@ -1,4 +1,3 @@ - include: - tor.install - tor.config diff --git a/tor/install.sls b/tor/install.sls index 63cecef..876d4e8 100644 --- a/tor/install.sls +++ b/tor/install.sls @@ -1,4 +1,4 @@ -{% from "tor/map.jinja" import map with context %} +{%- from "tor/map.jinja" import map with context -%} install_tor: pkg.installed: diff --git a/tor/map.jinja b/tor/map.jinja index 1eb8eeb..3a2288f 100644 --- a/tor/map.jinja +++ b/tor/map.jinja @@ -1,10 +1,8 @@ -{% import_yaml "tor/defaults.yaml" as defaults %} -{% import_yaml "tor/osfamilymap.yaml" as osfamilymap %} +{%- import_yaml "tor/defaults.yaml" as defaults -%} +{%- import_yaml "tor/osfamilymap.yaml" as osfamilymap -%} -{% set map = salt['grains.filter_by'](defaults, +{%- set map = salt['grains.filter_by'](defaults, merge=salt['grains.filter_by']( osfamilymap, grain='os_family', merge=salt['pillar.get']('tor', {}), ), -base='tor') %} - - +base='tor') -%} diff --git a/tor/torsocks.sls b/tor/torsocks.sls index ad71388..93157b2 100644 --- a/tor/torsocks.sls +++ b/tor/torsocks.sls @@ -1,4 +1,4 @@ -{% from "tor/map.jinja" import map with context %} +{%- from "tor/map.jinja" import map with context -%} install_torsocks: pkg.installed: