Initial ansible onboard

This commit is contained in:
2024-09-24 15:19:51 +02:00
parent 7366659355
commit f445996797
492 changed files with 2214589 additions and 0 deletions
+11
View File
@@ -0,0 +1,11 @@
#!/bin/bash
NAMESPACE=gitea
PREFIX=gitea-app
# Get the list of running pod names in the given namespace and filter by prefix
POD_NAME=$(/usr/local/bin/kubectl get pods -n "$NAMESPACE" -o json | jq -r --arg PREFIX "$PREFIX" '.items[] | select(.metadata.name | startswith($PREFIX)) | select(.status.phase == "Running") | .metadata.name' | head -n 1)
# Check if a running pod matching the prefix is found
if [ -z "$POD_NAME" ]; then
exit 1
else
/usr/local/bin/kubectl exec -n "$NAMESPACE" "$POD_NAME" -i -- su -s /bin/bash git -- /usr/local/bin/gitea keys -c /data/gitea/conf/app.ini -e git "$@"
fi