node-stopping.yml

Overview

The node-stopping.yml file is an automation playbook designed to manage the stopping process of "block keeper" nodes within a distributed system. It focuses on safely halting these nodes while optionally configuring behavior parameters such as whether to delete data or perform a fast update. The playbook is executed on a specified group of hosts, with default targeting set to the block_keepers inventory group.

This playbook is part of the orchestration system that controls lifecycle management of block keeper nodes, ensuring coordinated stopping actions, which may be critical for maintenance, upgrades, or controlled shutdowns.

Structure and Components

Play Definition

Variables

The playbook defines several variables to control its behavior:

Roles

Important Implementation Details

Interaction with Other System Components

Usage Example

To run this playbook and stop the default group of block keeper nodes without deleting data:

ansible-playbook node-stopping.yml

To target a specific subset of block keeper nodes, e.g., block_keepers_1:

ansible-playbook node-stopping.yml -e "target=block_keepers_1"

To stop nodes and delete their data:

ansible-playbook node-stopping.yml -e "DELETE_DATA=yes"

Visual Diagram

flowchart TD
A[Start node-stopping.yml playbook]
B{Determine target hosts}
C[Set variables: DELETE_DATA, DO_STOP, DO_START, FAST_UPDATE]
D[Invoke block-keeper role]
E{Role reads variables}
F[Stop block keeper nodes]
G{If DELETE_DATA = yes}
H[Delete block keeper data]
I[Complete stopping process]
A --> B --> C --> D --> E
E --> F
F --> G
G -->|yes| H --> I
G -->|no| I

This flowchart illustrates the main workflow of the playbook: selecting target hosts, setting control variables, invoking the role, performing the stop operation, optionally deleting data, and completing the process.