stop-bm.yaml

Overview

The stop-bm.yaml file is an Ansible playbook snippet designed to manage the stopping of services orchestrated by Docker Compose within a specified directory. It contains two primary tasks that handle service shutdown with different levels of force:

This file is intended to be used as part of automation workflows where controlled shutdown of containerized services is required.

Tasks and Functionality

1. Compose stop

2. Compose stop (hard)

Implementation Details

Interaction with Other System Components

Visual Diagram

flowchart TD
A[Start Playbook] --> B[Compose stop]
B -->|Executes: docker compose stop| C{Containers stopped?}
C -- Yes --> D[Graceful shutdown complete]
C -- No --> E["Compose stop (hard)"]
E -->|Executes: docker compose kill| F[Forced shutdown complete]

This flowchart illustrates the sequence of operations: initially attempting a graceful stop of Docker Compose services, and if necessary, performing a forced kill to ensure all containers are terminated.