2024-10-14 23:15:34 +05:00
|
|
|
---
|
|
|
|
- name: Create tor directories
|
|
|
|
become: true
|
|
|
|
ansible.builtin.file:
|
|
|
|
path: "{{ item }}"
|
|
|
|
state: directory
|
|
|
|
mode: "1700"
|
|
|
|
owner: 100
|
|
|
|
loop:
|
|
|
|
- /etc/tor
|
|
|
|
- /var/lib/tor
|
|
|
|
- /var/lib/tor/mastodon
|
2024-10-24 12:47:12 +05:00
|
|
|
- /var/lib/tor/peertube
|
|
|
|
- /var/lib/tor/comfycamp
|
2024-10-14 23:15:34 +05:00
|
|
|
- name: Copy tor config
|
|
|
|
become: true
|
|
|
|
ansible.builtin.template:
|
|
|
|
src: torrc.j2
|
|
|
|
dest: /etc/tor/torrc
|
|
|
|
owner: 100
|
|
|
|
mode: "0600"
|
|
|
|
register: torrc
|
|
|
|
- name: Copy tor files
|
|
|
|
become: true
|
|
|
|
ansible.builtin.copy:
|
|
|
|
src: "{{ item }}"
|
|
|
|
dest: /var/lib/tor/{{ item }}
|
|
|
|
owner: 100
|
|
|
|
mode: "0600"
|
|
|
|
loop:
|
|
|
|
- mastodon/hostname
|
|
|
|
- mastodon/hs_ed25519_public_key
|
|
|
|
- mastodon/hs_ed25519_secret_key
|
2024-10-24 12:47:12 +05:00
|
|
|
- peertube/hostname
|
|
|
|
- peertube/hs_ed25519_public_key
|
|
|
|
- peertube/hs_ed25519_secret_key
|
|
|
|
- comfycamp/hostname
|
|
|
|
- comfycamp/hs_ed25519_public_key
|
|
|
|
- comfycamp/hs_ed25519_secret_key
|
2024-10-14 23:15:34 +05:00
|
|
|
register: tor_files
|
|
|
|
- name: Create tor network
|
|
|
|
become: true
|
|
|
|
community.docker.docker_network:
|
|
|
|
name: tor
|
|
|
|
- name: Run tor container
|
|
|
|
become: true
|
|
|
|
community.docker.docker_container:
|
|
|
|
name: tor
|
|
|
|
image: git.comfycamp.space/lumin/homelab-tor:v0.0.2
|
|
|
|
networks:
|
|
|
|
- name: tor
|
2024-10-15 00:24:44 +05:00
|
|
|
- name: haproxy
|
2024-10-14 23:15:34 +05:00
|
|
|
volumes:
|
|
|
|
- /etc/tor:/etc/tor:ro
|
|
|
|
- /var/lib/tor:/var/lib/tor
|
|
|
|
recreate: "{{ torrc.changed or tor_files.changed }}"
|
2024-10-30 17:55:20 +05:00
|
|
|
restart_policy: unless-stopped
|