From 91a247868baa0870400d549ada221bc3711bbf61 Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Wed, 7 Feb 2024 22:12:08 +0000 Subject: [PATCH] Add routes from forrest to tailscale network --- ansible/main.yml | 1 + .../roles/pve_tailscale_route/tasks/main.yml | 22 +++++++++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 ansible/roles/pve_tailscale_route/tasks/main.yml 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