mariadb.yml aktualisiert

This commit is contained in:
olli 2024-05-28 13:39:58 +02:00
parent 0973a32533
commit dbf60e2555

View File

@ -60,14 +60,18 @@
marker: "# {mark} ANSIBLE MANAGED BLOCK"
block: |
cd /home/docker/mariadb.{{inventory_hostname}}
# start phpmyadmin (if not) to force traefik to get a letsencrypt certificate
docker compose up -d mariadb.{{inventory_hostname}}--phpmyadmin
mkdir -p ssl
# take letsencrypt-certs from traefik and check for new ones
new=0
for ssl in key certificate
do
touch ssl/${ssl}.pem
[ -d ssl/${ssl}.pem ] && rm -r ssl/${ssl}.pem
until [ -s "ssl/${ssl}.pem.new" ]
do
cat /home/docker/traefik/letsencrypt/acme.json | jq -r ".letsencrypt.Certificates[] | select(.domain.main==\"mariadb.{{inventory_hostname}}\") | .${ssl}" | base64 -d >ssl/${ssl}.pem.new
@ -89,6 +93,10 @@
if [ -n "$new" ]
then
until [ -s "db-data/mysql_upgrade_info" ]
do
sleep 5
done
docker compose down
docker compose up -d
fi