playbooks/remove-autorestic: quote the ! in the binary-absent verify (YAML tag indicator)
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.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user