Initial commit

This commit is contained in:
Alex 2020-04-16 20:34:42 +02:00
commit b385165ce2
Signed by: caskd
GPG Key ID: F92BA85F61F4C173
4 changed files with 53 additions and 0 deletions

9
handlers/main.yml Normal file
View File

@ -0,0 +1,9 @@
- name: Enable tor
systemd:
name: 'tor@default'
enabled: yes
state: started
- name: Restart tor
systemd:
name: 'tor@default'
state: restarted

27
tasks/main.yml Normal file
View File

@ -0,0 +1,27 @@
- name: Create configuration directory
file:
path: '/etc/tor'
state: directory
tags:
- setup
- configs
- name: Copy configuration files
template:
follow: yes
src: 'torrc.j2'
dest: '/etc/tor/torrc'
notify: Restart tor
tags:
- update
- configs
- name: Install tor
apt:
install_recommends: no
name:
- tor
state: present
cache_valid_time: 3600
tags:
- setup
- packages
notify: Enable tor

9
templates/torrc.j2 Normal file
View File

@ -0,0 +1,9 @@
SocksPort {{ tor.listen.socks.addr }}:{{ tor.listen.socks.port }}
SocksPolicy accept {{ tor.listen.socks.addr }}/24
SocksPolicy reject *
HTTPTunnelPort {{ tor.listen.http.addr }}:{{ tor.listen.http.port }}
AvoidDiskWrites 1
ClientOnly 1
ConnectionPadding 1
NewCircuitPeriod 10
EnforceDistinctSubnets 1

8
vars/main.yml Normal file
View File

@ -0,0 +1,8 @@
tor:
listen:
socks:
addr: "127.0.0.1"
port: "9050"
http:
addr: "127.0.0.1"
port: "7050"