aboutsummaryrefslogtreecommitdiff
path: root/roles/tor/tasks/ssh_hidden_service.yaml
diff options
context:
space:
mode:
Diffstat (limited to 'roles/tor/tasks/ssh_hidden_service.yaml')
-rw-r--r--roles/tor/tasks/ssh_hidden_service.yaml14
1 files changed, 10 insertions, 4 deletions
diff --git a/roles/tor/tasks/ssh_hidden_service.yaml b/roles/tor/tasks/ssh_hidden_service.yaml
index cbac7fa..d2415f2 100644
--- a/roles/tor/tasks/ssh_hidden_service.yaml
+++ b/roles/tor/tasks/ssh_hidden_service.yaml
@@ -13,7 +13,13 @@
block: |
HiddenServiceDir /var/lib/tor/ssh
HiddenServicePort 22 127.0.0.1:22
- notify: restart tor
+
+- name: restart tor
+ systemd:
+ name: tor
+ state: restarted
+ enabled: true
+ when: ansible_service_mgr == 'systemd'
- name: wait for hidden service hostname file
wait_for:
@@ -78,7 +84,7 @@
fetch:
src: /root/.ssh/id_ed25519_onion
dest: "./{{ onion_address }}/{{ onion_address }}_id_ed25519"
- flat: yes
+ flat: true
- name: set correct permissions on fetched hidden service private key
file:
@@ -90,13 +96,13 @@
fetch:
src: /root/.ssh/id_ed25519_onion.pub
dest: "./{{ onion_address }}/{{ onion_address }}_id_ed25519.pub"
- flat: yes
+ flat: true
- name: fetch hidden service private key
fetch:
src: "/var/lib/tor/ssh/hs_ed25519_secret_key"
dest: "./{{ onion_address }}/hs_ed25519_secret_key"
- flat: yes
+ flat: true
mode: '0600'
- name: generate onion-specific ssh config snippet