From 98cd18e0dbda56f1716f0ff1acab1d0b182ac02b Mon Sep 17 00:00:00 2001 From: Artis3n Date: Fri, 23 Jun 2023 19:33:59 -0400 Subject: [PATCH 1/2] ci: add check mode test --- molecule/default/molecule.yml | 1 + tasks/install.yml | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/molecule/default/molecule.yml b/molecule/default/molecule.yml index 3ba7f3ac..2dada7f4 100644 --- a/molecule/default/molecule.yml +++ b/molecule/default/molecule.yml @@ -41,6 +41,7 @@ scenario: - prepare - converge - idempotence + - check - verify - cleanup - destroy diff --git a/tasks/install.yml b/tasks/install.yml index bda1003d..234d32ff 100644 --- a/tasks/install.yml +++ b/tasks/install.yml @@ -73,7 +73,7 @@ - name: Install | Tailscale version and online status ansible.builtin.debug: - msg: "Ver: {{ tailscale_version }} Online: {{ tailscale_is_online }}" + msg: "Ver: {{ tailscale_version }}, Online: {{ tailscale_is_online }}" when: verbose - name: Install | Save State From 01e2b4af76be084fbe46bc8aab5492b2769cb915 Mon Sep 17 00:00:00 2001 From: Eric Eisenhart <1577595+eric-eisenhart@users.noreply.github.com> Date: Wed, 17 Apr 2024 10:52:55 -0700 Subject: [PATCH 2/2] Run `tailscale status` in check mode The `tailscale status --json` is purely gathering data (doesn't change anything), so it's ok to run this in check mode. --- tasks/install.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tasks/install.yml b/tasks/install.yml index 234d32ff..5109fce8 100644 --- a/tasks/install.yml +++ b/tasks/install.yml @@ -62,6 +62,8 @@ - name: Install | Fetch Tailscale status ansible.builtin.command: tailscale status --json changed_when: false + # data gathering, not a change, so ok to run in check mode + check_mode: false register: tailscale_status - name: Install | Parse status JSON