From 7a2f8a1954d58dfc7c9629cb5c4340d0fd3adfbc Mon Sep 17 00:00:00 2001 From: Vuong Hoang Date: Sun, 26 Apr 2026 14:43:02 -0700 Subject: [PATCH] playbooks/remove-autorestic: quote the ! in the binary-absent verify (YAML tag indicator) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit YAML treats a leading `!` as a tag indicator, so the unquoted `shell: ! command -v autorestic >/dev/null` was parsed as a tagged scalar with the `!` stripped. The verify ended up running just `command -v autorestic >/dev/null` — which exits non-zero when autorestic is absent, the OPPOSITE of what the assertion needed. Quoted version `"! command -v autorestic >/dev/null"` survives parsing and gives the intended bash negation. --- playbooks/remove-autorestic.yaml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/playbooks/remove-autorestic.yaml b/playbooks/remove-autorestic.yaml index 8545c2b..ed49d14 100644 --- a/playbooks/remove-autorestic.yaml +++ b/playbooks/remove-autorestic.yaml @@ -80,7 +80,11 @@ verify: changed_when: "false" - name: No autorestic binary on PATH - shell: ! command -v autorestic >/dev/null + # Quoted because YAML treats a leading `!` as a tag indicator — + # unquoted, the parser strips it and the verify ends up running + # `command -v autorestic` (exits non-zero when autorestic is gone, + # which is the OPPOSITE of what we want here). + shell: "! command -v autorestic >/dev/null" changed_when: "false" - name: systemd no longer knows about autorestic units