feat(monitoring): add core-mon ansible playbook, roles, workflows, and traefik routes
This commit is contained in:
1 parent
9e9b8e9caf
commit
f26e0bfe57
16 files changed
+352
-3
No files matched your search
@@ -13,7 +13,7 @@ before=${3:-}
|
||||
after=${4:-}
|
||||
|
||||
case "$machine" in
|
||||
core-net | core-secrets | rus-central | opnsense) ;;
|
||||
core-net | core-secrets | core-mon | rus-central | opnsense) ;;
|
||||
*)
|
||||
echo "Неизвестная машина: $machine" >&2
|
||||
exit 2
|
||||
|
||||
@@ -9,7 +9,7 @@ before=${3:-}
|
||||
after=${4:-}
|
||||
|
||||
case "$machine" in
|
||||
core-net | core-secrets | rus-central | opnsense) ;;
|
||||
core-net | core-secrets | core-mon | rus-central | opnsense) ;;
|
||||
*)
|
||||
echo "Неизвестная машина: $machine" >&2
|
||||
exit 2
|
||||
@@ -68,6 +68,20 @@ case "$machine" in
|
||||
export INFISICAL_ENCRYPTION_KEY="${ENCRYPTION_KEY}"
|
||||
export INFISICAL_AUTH_SECRET="${AUTH_SECRET}"
|
||||
;;
|
||||
core-mon)
|
||||
if ! infisical export --domain="${INFISICAL_DOMAIN}" --token="${TOKEN}" --env=prod --projectId="${INFISICAL_PROJECT_ID}" --path="/services/monitoring" --format=dotenv-export --silent 2>/dev/null | grep -q 'GRAFANA_ADMIN_PASSWORD'; then
|
||||
infisical secrets-manager folders create monitoring --path /services --env prod --projectId "${INFISICAL_PROJECT_ID}" --domain "${INFISICAL_DOMAIN}" --token "${TOKEN}" --silent 2>/dev/null || true
|
||||
GEN_GRAFANA_PASS=$(openssl rand -base64 32 | tr -dc 'a-zA-Z0-9' | head -c 24)
|
||||
infisical secrets set --domain="${INFISICAL_DOMAIN}" --token="${TOKEN}" --env=prod --projectId="${INFISICAL_PROJECT_ID}" --path="/services/monitoring" \
|
||||
"GRAFANA_ADMIN_USER=admin" \
|
||||
"GRAFANA_ADMIN_PASSWORD=${GEN_GRAFANA_PASS}" \
|
||||
--silent
|
||||
unset GEN_GRAFANA_PASS
|
||||
fi
|
||||
eval "$(infisical export --domain="${INFISICAL_DOMAIN}" --token="${TOKEN}" --env=prod --projectId="${INFISICAL_PROJECT_ID}" --path="/services/monitoring" --format=dotenv-export --silent)"
|
||||
export GRAFANA_ADMIN_USER="${GRAFANA_ADMIN_USER:-admin}"
|
||||
export GRAFANA_ADMIN_PASSWORD="${GRAFANA_ADMIN_PASSWORD:-}"
|
||||
;;
|
||||
rus-central)
|
||||
input_email="${INPUT_LETSENCRYPT_EMAIL:-}"
|
||||
eval "$(infisical export --domain="${INFISICAL_DOMAIN}" --token="${TOKEN}" --env=prod --projectId="${INFISICAL_PROJECT_ID}" --path="/services/netbird" --format=dotenv-export --silent)"
|
||||
|
||||
Reference in new issue
Block a user