From c254770d6b861cc71bd6ae262982193b5ccd8945 Mon Sep 17 00:00:00 2001 From: kieranmanning Date: Sat, 14 Dec 2024 12:38:06 +0000 Subject: [PATCH 1/2] fix: return faked response from up status check in check mode --- handlers/main.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/handlers/main.yml b/handlers/main.yml index 857c8ac5..ab988438 100644 --- a/handlers/main.yml +++ b/handlers/main.yml @@ -11,6 +11,13 @@ status: "{{ tailscale_status.stdout | from_json }}" ansible.builtin.set_fact: tailscale_is_online: "{{ status.Self.Online }}" + when: not ansible_check_mode + +- name: return faked response from JSON status check when in check mode + listen: Confirm Tailscale is Connected + ansible.builtin.set_fact: + tailscale_is_online: true + when: ansible_check_mode - name: Tailscale online status listen: Confirm Tailscale is Connected From 0e584f92787f7c3ab2766d156f54db9912619ef4 Mon Sep 17 00:00:00 2001 From: kieranmanning Date: Wed, 18 Dec 2024 10:57:52 +0000 Subject: [PATCH 2/2] fix: disable status fetch in check mode --- handlers/main.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/handlers/main.yml b/handlers/main.yml index ab988438..fc763eb0 100644 --- a/handlers/main.yml +++ b/handlers/main.yml @@ -4,6 +4,7 @@ ansible.builtin.command: tailscale status --json changed_when: false register: tailscale_status + when: not ansible_check_mode - name: Parse status JSON listen: Confirm Tailscale is Connected