[P2] Silent failures in deploy/disaster/redeploy — ignore_errors everywhere with no assertions #3

Closed
opened 2026-03-22 18:04:10 +00:00 by jeet · 0 comments
Owner

Problem

Three tasks in a row suppress all errors:

  1. docker compose up -dignore_errors: true
  2. 30-second pause
  3. Container status check → ignore_errors: true (registers container_status but never asserts on it)

Deployments can silently fail while the playbook reports green. You only find out when a service is unreachable.

Fix

Replace the status check with a real assertion:

- name: Check container status
  ansible.builtin.shell: docker compose ps --services --filter status=running
  args:
    chdir: ~/docker
  register: running_containers
  changed_when: false

- name: Fail if any containers are not running
  ansible.builtin.fail:
    msg: "Some containers failed to start"
  when: running_containers.stdout_lines | length == 0

Files: playbooks/deploy.yml, playbooks/disaster.yml, playbooks/redeploy.yml

## Problem Three tasks in a row suppress all errors: 1. `docker compose up -d` → `ignore_errors: true` 2. 30-second pause 3. Container status check → `ignore_errors: true` (registers `container_status` but never asserts on it) Deployments can silently fail while the playbook reports green. You only find out when a service is unreachable. ## Fix Replace the status check with a real assertion: ```yaml - name: Check container status ansible.builtin.shell: docker compose ps --services --filter status=running args: chdir: ~/docker register: running_containers changed_when: false - name: Fail if any containers are not running ansible.builtin.fail: msg: "Some containers failed to start" when: running_containers.stdout_lines | length == 0 ``` **Files:** `playbooks/deploy.yml`, `playbooks/disaster.yml`, `playbooks/redeploy.yml`
jeet closed this issue 2026-03-22 18:14:21 +00:00
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: jeet/OCI_Build#3