From ffea5f1ab33643bdaa6424874e9b47f26821705d Mon Sep 17 00:00:00 2001 From: sawyer bristol Date: Fri, 13 Sep 2024 16:05:39 -0600 Subject: [PATCH] only run tailscale if not up already --- tasks/tailscale.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tasks/tailscale.yml b/tasks/tailscale.yml index d04259b..c6b7e6a 100644 --- a/tasks/tailscale.yml +++ b/tasks/tailscale.yml @@ -1,5 +1,12 @@ --- + - name: check if tailscale up already + ansible.builtin.shell: tailscale status + register: ansible_up + ignore_errors: true + changed_when: false + - name: Get tailscale key + when: ansible_up.rc != 0 become: false ansible.builtin.shell: cat ~/compose-files/secrets.env | grep TS_AUTHKEY | sed 's/^.*TS_AUTHKEY=//' @@ -8,10 +15,12 @@ changed_when: false - name: Set tailscale_authkey + when: ansible_up.rc != 0 ansible.builtin.set_fact: tailscale_authkey: "{{ ansible_key.stdout }}" - name: Run tailscale role + when: ansible_up.rc != 0 include_role: name: artis3n.tailscale vars: