071-check-repmgr-master.sh 343 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
#!/bin/bash

set -eu

# shellcheck source=/dev/null
source "${BASE}/env_${ENVIRONMENT}"

echo "Checking state of $AZURE_MASTER"
if ssh_remote "$AZURE_MASTER" sudo -u gitlab-consul gitlab-ctl repmgr-check-master 2> /dev/null
then
  echo "$AZURE_MASTER is repmgr master"
  exit 0
else
  >&2 echo "$AZURE_MASTER is not repmgr master"
  exit 1
fi