revert(fleet): switch back to MySQL, MariaDB incompatible with Fleet migrations
MariaDB fails on migration 20240905200000_UninstallPackages due to SQL syntax incompatibility (MODIFY COLUMN ... NULL). Use real MySQL with manual DB setup instead of setup_mariadb_db.
This commit is contained in:
@@ -13,8 +13,17 @@ setting_up_container
|
||||
network_check
|
||||
update_os
|
||||
|
||||
setup_mariadb
|
||||
MARIADB_DB_NAME="fleet" MARIADB_DB_USER="fleet" setup_mariadb_db
|
||||
setup_mysql
|
||||
|
||||
msg_info "Setting up Database"
|
||||
FLEET_DB_PASS=$(openssl rand -base64 18 | tr -dc 'a-zA-Z0-9' | head -c 13)
|
||||
$STD mysql -u root <<EOSQL
|
||||
CREATE DATABASE fleet;
|
||||
CREATE USER 'fleet'@'localhost' IDENTIFIED BY '${FLEET_DB_PASS}';
|
||||
GRANT ALL PRIVILEGES ON fleet.* TO 'fleet'@'localhost';
|
||||
FLUSH PRIVILEGES;
|
||||
EOSQL
|
||||
msg_ok "Set up Database"
|
||||
|
||||
fetch_and_deploy_gh_release "fleet" "fleetdm/fleet" "prebuild" "latest" "/opt/fleet" "fleet_v*_linux.tar.gz"
|
||||
|
||||
@@ -25,7 +34,7 @@ cat <<EOF >/opt/fleet/.env
|
||||
FLEET_MYSQL_ADDRESS=127.0.0.1:3306
|
||||
FLEET_MYSQL_DATABASE=fleet
|
||||
FLEET_MYSQL_USERNAME=fleet
|
||||
FLEET_MYSQL_PASSWORD=${MARIADB_DB_PASS}
|
||||
FLEET_MYSQL_PASSWORD=${FLEET_DB_PASS}
|
||||
FLEET_SERVER_ADDRESS=0.0.0.0:8080
|
||||
FLEET_SERVER_TLS=false
|
||||
FLEET_AUTH_JWT_KEY=${JWT_KEY}
|
||||
@@ -42,8 +51,8 @@ msg_info "Creating Service"
|
||||
cat <<EOF >/etc/systemd/system/fleet.service
|
||||
[Unit]
|
||||
Description=Fleet
|
||||
After=network.target mariadb.service
|
||||
Requires=mariadb.service
|
||||
After=network.target mysql.service
|
||||
Requires=mysql.service
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
|
||||
Reference in New Issue
Block a user