fix(delivery): add PostgreSQL rollback and CloudDM isolation

This commit is contained in:
l x
2026-07-31 11:16:19 +08:00
parent 66fde73792
commit 363ad5f9be
15 changed files with 872 additions and 224 deletions
+9
View File
@@ -17,6 +17,8 @@ The local object mapping is:
| Secret credential | `XINFRA PostgreSQL Runtime Secrets` |
| Job Template | `XINFRA PostgreSQL Delivery` |
| Playbook | `postgresql-deploy.yml` |
| Rollback Template | `XINFRA PostgreSQL Rollback` |
| Rollback Playbook | `postgresql-rollback.yml` |
| Instance Group | `xinfra-e2e-execution` |
Run the idempotent setup whenever the AWX task pod restarts or the local
@@ -25,6 +27,13 @@ cannot use a Manual Project, so the Project is Git-backed with launch updates
disabled. The script refreshes a local Git source inside the AWX task pod and
runs a project update so AWX rebuilds its playbook index.
The setup output includes `DELIVERY_POSTGRESQL_ROLLBACK_TEMPLATE_ID`; copy that
value into `config/local/server-postgresql.env` before starting the scheduler.
PostgreSQL CloudDM registration is optional and requires the dedicated URL,
API token, username, and password documented in the server env example. The
CloudDM password must match the PostgreSQL administrator password configured
in the AWX runtime credential.
```bash
./scripts/setup-postgresql-awx.sh
```
+3
View File
@@ -40,4 +40,7 @@ XINFRA_POSTGRES_REPLICATION_PASSWORD=
AWX_JOB_TEMPLATE_NAME="XINFRA PostgreSQL Delivery"
AWX_JOB_TEMPLATE_DESCRIPTION="PostgreSQL host_pool delivery template for XINFRA"
AWX_PLAYBOOK=postgresql-deploy.yml
AWX_ROLLBACK_JOB_TEMPLATE_NAME="XINFRA PostgreSQL Rollback"
AWX_ROLLBACK_JOB_TEMPLATE_DESCRIPTION="PostgreSQL compensating cleanup template for XINFRA"
AWX_ROLLBACK_PLAYBOOK=postgresql-rollback.yml
AWX_INSTANCE_GROUP=xinfra-e2e-execution
@@ -14,3 +14,11 @@ DELIVERY_GLOBAL_LIMIT=2
DELIVERY_TARGET_LIMIT=2
DELIVERY_BUSINESS_LIMIT=1
DELIVERY_DATA_DISKS=/data
DELIVERY_POSTGRESQL_ROLLBACK_TEMPLATE_ID=0
# Optional PostgreSQL CloudDM registration. Keep the URL empty to disable it.
# The password must match the postgres administrator password delivered by AWX.
CLOUDDM_POSTGRESQL_REGISTER_URL=
CLOUDDM_API_TOKEN=
CLOUDDM_POSTGRESQL_USERNAME=postgres
CLOUDDM_POSTGRESQL_PASSWORD=