diff --git a/ansible/main.yml b/ansible/main.yml index 5335a83..30f410b 100644 --- a/ansible/main.yml +++ b/ansible/main.yml @@ -97,6 +97,7 @@ roles: - forrest - pve_nebula_route + - pve_tailscale_route - hosts: qbittorrent roles: diff --git a/ansible/roles/pve_tailscale_route/tasks/main.yml b/ansible/roles/pve_tailscale_route/tasks/main.yml new file mode 100644 index 0000000..ee0e7fb --- /dev/null +++ b/ansible/roles/pve_tailscale_route/tasks/main.yml @@ -0,0 +1,22 @@ +- name: Get routes + command: + argv: + - ip + - route + - show + - "{{ tailscale_cidr }}" + register: routes + changed_when: false + become: true + +- name: Add route to tailscale hosts via ingress + command: + argv: + - ip + - route + - add + - "{{ tailscale_cidr }}" + - via + - "{{ pve_hosts.ingress.ip }}" + become: true + when: tailscale_cidr not in routes.stdout