feat(delivery): extend MySQL delivery parameters and tighten resource bounds

- Add topology/port/data_disk, DB options and 8 advanced parameters
  with whitelist validation, rendered via extra_vars into the playbook
- Hybrid port allocation over pool 13306-13999
- Tighten bounds: memory 2048-65536 MiB, storage 20-2000 GiB
This commit is contained in:
Hungerdream
2026-07-27 15:16:57 +08:00
parent e4596d5662
commit 3c3645f8d5
6 changed files with 492 additions and 85 deletions
+10
View File
@@ -70,6 +70,7 @@ type Config struct {
DeliveryGlobalLimit int
DeliveryTargetLimit int
DeliveryBusinessLimit int
DeliveryDataDisks []string
}
func Load() Config {
@@ -138,6 +139,7 @@ func Load() Config {
DeliveryGlobalLimit: envInt("DELIVERY_GLOBAL_LIMIT", 2),
DeliveryTargetLimit: envInt("DELIVERY_TARGET_LIMIT", 2),
DeliveryBusinessLimit: envInt("DELIVERY_BUSINESS_LIMIT", 1),
DeliveryDataDisks: envCSV("DELIVERY_DATA_DISKS", "/data"),
}
}
@@ -241,6 +243,14 @@ func envInt(key string, fallback int) int {
return parsed
}
func envCSV(key, fallback string) []string {
items := splitCSV(env(key, fallback))
if len(items) == 0 {
items = splitCSV(fallback)
}
return items
}
func defaultPublicBaseURL(httpAddr string) string {
addr := strings.TrimSpace(httpAddr)
if addr == "" {