#!/bin/bash -e
# Ask the installation mode of this node (simple, cloud simple or cloud
# advanced, handbook decisions 0028 and 0076), then its role: in a cloud
# mode the primary, the replica or the witness, each taken through the
# mesh and the pair (keel mesh, keel vip); a simple database appliance
# records standalone. The screens are confconsole's, the same ones that
# finish the job later. The mode is not asked when the instance
# description declares installation.mode, the role when it declares
# database.server.role or an overlay address. A question nobody can answer
# at the console is left to keel-init (lib/keel-firstboot.sh).
#
# Position: after the application's hooks (35mysqlpass and the ones
# after it), because a replica replaces the database they created, and
# before 80keel-cloud.

INITHOOKS_DEFAULT="${INITHOOKS_DEFAULT:-/etc/default/inithooks}"
# shellcheck source=default/inithooks
source "$INITHOOKS_DEFAULT"
# shellcheck source=lib/keel-firstboot.sh
source "$INITHOOKS_PATH/lib/keel-firstboot.sh"

keel_firstboot mode
keel_firstboot role
