From 33fbc066812bc14b2ae179da50b5f8393b1d367b Mon Sep 17 00:00:00 2001 From: Sergei Poljanski Date: Thu, 12 Nov 2026 06:50:37 +0400 Subject: [PATCH] base: do not fail when the prune entry is root's only cron line grep -v exits 1 when it prints nothing, and with pipefail that failed the task on both hosts, although the crontab had been rewritten correctly. Ignore grep's exit status. Assisted-by: Claude:fable-5-2 --- ansible/roles/base/tasks/main.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ansible/roles/base/tasks/main.yaml b/ansible/roles/base/tasks/main.yaml index 0c9b9d0..f073e85 100644 --- a/ansible/roles/base/tasks/main.yaml +++ b/ansible/roles/base/tasks/main.yaml @@ -70,7 +70,7 @@ - name: Drop the old prune entry from root's crontab ansible.builtin.shell: | set -o pipefail - crontab -l | grep -v 'docker image prune' | crontab - + crontab -l | { grep -v 'docker image prune' || true; } | crontab - args: executable: /bin/bash when: "'docker image prune' in root_crontab.stdout"