kali-autosetup/roles/tor_gateway/tasks/main.yml

48 lines
887 B
YAML
Raw Normal View History

2022-07-28 19:14:01 +02:00
- name: Install tor
apt:
name: tor
update_cache: yes
- name: Set torrc file
template:
src: torrc.j2
dest: /etc/tor/torrc
2022-07-28 19:27:15 +02:00
- name: Install iptables-persistent
apt:
name: iptables-persistent
state: present
2022-07-28 22:15:29 +02:00
- name: Template & copy iptables script
template:
src: iptables.sh.j2
dest: iptables.sh
- name: Execute iptables script
2022-07-28 19:14:01 +02:00
become: yes
2022-07-28 22:15:29 +02:00
shell: bash iptables.sh
2022-07-28 19:14:01 +02:00
2022-07-28 21:57:18 +02:00
- name: set nameserver to localhost
copy:
content: "nameserver 127.0.0.1"
dest: /etc/resolv.conf
2022-07-28 19:14:01 +02:00
2022-07-28 21:57:18 +02:00
- name: Restart systemd-resolved
service:
name: systemd-resolved
state: restarted
daemon_reload: yes
2022-07-28 19:14:01 +02:00
2022-07-28 22:06:19 +02:00
- name: Ensure log file exists
file:
path: "{{ tor_logfile_path }}"
state: touch
owner: debian-tor
mode: 0644
2022-07-28 21:57:18 +02:00
- name: (Re)start and enable tor service
2022-07-28 19:14:01 +02:00
service:
name: tor
2022-07-28 21:57:18 +02:00
state: restarted
2022-07-28 19:14:01 +02:00
enabled: yes
daemon_reload: yes