Commit Graph

15 Commits

Author SHA1 Message Date
mac 35875218c9 feat(delivery): refine base service integrations 2026-07-29 16:47:41 +08:00
Hungerdream e30f547891 fix(ansible): harden mysql data_disk path validation
Reject bare '/', path traversal ('..') and duplicated slashes ('//') in mysql_data_disk assertions to avoid deploying into unsafe directories.
2026-07-28 19:14:50 +08:00
mac f7be87c7d9 feat: wire delivery result and infra data backends 2026-07-28 17:56:00 +08:00
mac 897670b721 Merge remote-tracking branch 'upstream/main' into feat/base-service-delivery
# Conflicts:
#	ansible/mysql-deploy.yml
#	frontend/src/api/delivery.ts
#	frontend/src/views/service/Catalog.vue
#	server/.env.example
#	server/internal/config/config.go
#	server/internal/handler/task_log.go
#	server/internal/service/delivery.go
2026-07-28 15:08:37 +08:00
mac 8e09c30d21 feat: wire mysql delivery to awx callbacks 2026-07-28 14:45:17 +08:00
Hungerdream 7a800b0307 fix(ansible): treat empty or auto redo capacity as unset
innodb_redo_log_capacity passed as '' or 'auto' from the delivery
payload previously bypassed the memory-based tier calculation and was
rendered verbatim into the instance config. Fall back to the automatic
tier when the value is empty or 'auto'.
2026-07-28 14:28:53 +08:00
Hungerdream b9a3ddd9e3 feat(ansible): add mysql-rollback playbook for instance cleanup
Add a compensating playbook that removes a single delivered MySQL
instance from a target host. The rollback scope is pinned by
target_hosts + instance_name + data_disk, with pre-task assertions
rejecting instance names or disk paths outside the delivery layout
to prevent accidental deletion.

- stop and disable mysql-delivery@<instance>.service, reset failed state
- remove instance data dir, install dir, config file and run dir
2026-07-28 14:28:42 +08:00
wonder c26790f84b docs(ansible): 为 mysql-deploy 相关文件添加详细中文注释
- mysql-deploy.yml: 为所有变量、任务、handlers 添加中文注释,解释参数含义、设计逻辑和平台契约
- mysql-delivery@.service: 为 Systemd 模板单元添加中文注释,说明 %i 参数机制、Type=notify、OOMScoreAdjust 等配置项
- mysql-instance.cnf.j2: 为 MySQL 配置模板添加中文注释,说明各参数含义、版本差异、复制配置逻辑
- inventory.example.yml: 为 Inventory 示例添加中文注释,说明主机组与拓扑对应关系及使用方式
2026-07-28 11:05:57 +08:00
mac 7b4b9d2ee7 Merge remote-tracking branch 'upstream/main' into feat/base-service-delivery
# Conflicts:
#	server/.env.example
#	server/internal/config/config.go
#	server/internal/service/delivery.go
#	server/internal/service/delivery_test.go
2026-07-28 09:34:37 +08:00
mac 4637228bae feat(delivery): add AWX callback MySQL playbook 2026-07-27 17:25:03 +08:00
Hungerdream bfb4f0df4d feat(delivery): complete MySQL version-to-package mapping
- 8.0 from Ubuntu archive, 8.4 from MySQL official APT repo
- 5.6/5.7 not supported for now; enforce one MySQL series per host
- Sync Go version whitelist with the playbook package map
2026-07-27 15:18:54 +08:00
Hungerdream e8e9612527 fix(ansible): use dict-form shell tasks with explicit bash
Free-form split_args breaks on quotes/Jinja at AWX runtime,
and default dash rejects pipefail.
2026-07-27 15:17:46 +08:00
Hungerdream 3c3645f8d5 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
2026-07-27 15:16:57 +08:00
mac f91df3be3d fix(delivery): address review feedback on idempotency, crash recovery, and security
- Idempotency: verify RequestedBy matches caller to prevent cross-user key reuse
- Crash recovery: persist ExecutionJob (launching) before AWX Launch, update to running after
- Terminal state: finish ExecutionJob on success/cancel/failure; failTask accepts canceling
- Reservation TTL: filter expired reservations in quota aggregation
- Ansible heredoc: use <<'EOF' to prevent shell expansion of secrets; escape single quotes
- Validation: align Go resource ranges with playbook (mem 1024-4096, storage 10-100)
- Version whitelist: only allow 8.0, pass mysql_version to AWX extra_vars; playbook selects package via map

Relates-to: #97
2026-07-23 14:39:09 +08:00
mac 5ddb434b74 feat(delivery): add Ansible playbook for native MySQL provisioning
Add mysql-deploy.yml playbook for bare-metal MySQL 8.0 delivery via
AWX: parameter validation, resource preflight checks, apt install,
AppArmor adaptation, per-instance directory layout, Jinja2 config
template (buffer pool sizing, binlog, GTID), systemd template unit
(mysql-delivery@.service), admin account setup, and TCP health
verification. Includes example inventory.

Relates-to: #97
2026-07-23 12:05:07 +08:00