Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: return faked response from up status check in check mode #524

Open
wants to merge 2 commits into
base: check-mode
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions handlers/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,21 @@
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
vars:
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
Expand Down