diff --git a/common-db/overlay/etc/sunet-machine-healthy/health-checks.d/db.check b/common-db/overlay/etc/sunet-machine-healthy/health-checks.d/db.check new file mode 100755 index 0000000..3f84c45 --- /dev/null +++ b/common-db/overlay/etc/sunet-machine-healthy/health-checks.d/db.check @@ -0,0 +1,13 @@ +#!/usr/bin/env bash + +set -e +set -o pipefail + + +while true; do + if /usr/bin/docker exec -it mariadb-db-1 mysql -p"$(puppet lookup --render-as s mariadb_root_password 2>/dev/null)" -e "show status like 'wsrep_cluster_status';" | grep -q Primary; then + exit 0 + fi + + sleep 3 +done