node-upgrading.yml

Overview

The node-upgrading.yml file is an Ansible playbook designed to manage the upgrade process of block keeper nodes within an infrastructure. It orchestrates a series of steps such as stopping services, upgrading components, and restarting essential processes across a targeted set of hosts. The playbook allows for configurable behavior through variables and interacts primarily with the block-keeper role to apply the upgrade logic.

Purpose and Functionality

Playbook Structure

Variables

Variable

Type

Default

Description

target

string

block_keepers

Defines the inventory group or host(s) where the playbook runs.

DELETE_DATA

boolean

no

Flag to indicate if node data should be deleted during the upgrade process.

DO_START

boolean

yes

Indicates whether to start services post-upgrade.

FAST_UPDATE

boolean

yes

Enables a faster upgrade method, possibly skipping some slower steps.

UPGRADE

list

See above

Specifies components and their upgrade steps in order.

Roles and Interactions

Usage Example

To run the upgrade on the default block_keepers hosts with default settings:

ansible-playbook node-upgrading.yml

To upgrade a specific host group block_keepers_test without deleting data and disabling fast update:

ansible-playbook node-upgrading.yml -e "target=block_keepers_test DELETE_DATA=no FAST_UPDATE=no"

Implementation Details

Mermaid Diagram: Workflow of node-upgrading.yml

flowchart TD
Start["Start Playbook"]
SetHosts["Set hosts: target or 'block_keepers'"]
Become["Become: yes (privilege escalation)"]
InitVars["Initialize variables (DELETE_DATA, DO_START, FAST_UPDATE, UPGRADE)"]
CallRole["Call role: block-keeper"]
UpgradeNode["Upgrade node: grsh stop + up"]
UpgradeCompose["Upgrade compose: grsh down + up"]
UpgradeAerospike["Upgrade aerospike: stop + up"]
UpgradeLogrotate["Upgrade logrotate: up + restart"]
End["End Playbook"]
Start --> SetHosts --> Become --> InitVars --> CallRole
CallRole --> UpgradeNode --> UpgradeCompose --> UpgradeAerospike --> UpgradeLogrotate --> End

This flowchart illustrates the sequential execution flow from playbook start through variable initialization, role invocation, and component upgrade steps.