# Copyright Red Hat, Inc. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. [Unit] Description=HotsTac(k)os MariaDB Service Documentation=https://github.com/openstack-k8s-operators/hotstack After=hotstack-os-infra-setup.service Requires=hotstack-os-infra-setup.service PartOf=hotstack-os.target [Service] Type=simple Restart=on-failure RestartSec=10 TimeoutStopSec=30 SuccessExitStatus=143 ExecStartPre=-/usr/bin/podman stop -t 2 hotstack-os-mariadb ExecStartPre=-/usr/bin/podman rm -f hotstack-os-mariadb ExecStart=/usr/bin/podman run \ --name hotstack-os-mariadb \ --network hotstack-os \ --network-alias mariadb \ --ip 172.31.0.3 \ --env MYSQL_ROOT_PASSWORD=rootpass \ --env MYSQL_PASSWORD=openstack \ --env MYSQL_USER=openstack \ --env MYSQL_DATABASE=keystone \ --volume /var/lib/hotstack-os/mysql:/var/lib/mysql/data:z \ --volume /var/lib/hotstack-os/runtime/scripts/init-db.sh:/usr/share/container-scripts/mysql/init/init-db.sh:ro,z \ --volume /var/lib/hotstack-os/runtime/config/mariadb/hotstack.cnf:/etc/my.cnf.d/hotstack.cnf:ro,z \ quay.io/fedora/mariadb-118:latest # Health check: CONTAINER INTERVAL TIMEOUT RETRIES START_PERIOD COMMAND ExecStartPost=-/usr/local/bin/hotstack-healthcheck.sh hotstack-os-mariadb 10 5 5 0 mysqladmin -uroot ping ExecStop=/usr/bin/podman stop -t 30 hotstack-os-mariadb ExecStopPost=-/usr/bin/podman rm -f hotstack-os-mariadb StandardOutput=journal StandardError=journal [Install] WantedBy=hotstack-os.target