2.6 KiB
2.6 KiB
playbooks
Traffic Billing Stack
The traffic billing stack now has a single aggregate playbook:
deploy_traffic_billing_stack.yml
It orchestrates these existing playbooks in dependency order:
deploy_xray_exporter.ymldeploy_billing_service.ymldeploy_accounts_svc_plus.ymldeploy_console_svc_plus.ymldeploy_agent_svc_plus.yml
Full stack deploy
cd /Users/shenlan/workspaces/cloud-neutral-toolkit/playbooks
export INTERNAL_SERVICE_TOKEN=...
export DATABASE_URL=postgres://...
export FRONTEND_IMAGE=ghcr.io/x-evor/dashboard:latest
ansible-playbook -i inventory.ini deploy_traffic_billing_stack.yml
Deploy to one target host directly
Use STACK_TARGET_HOST to override all service host groups with one inventory host.
cd /Users/shenlan/workspaces/cloud-neutral-toolkit/playbooks
export STACK_TARGET_HOST=jp-xhttp-contabo.svc.plus
export INTERNAL_SERVICE_TOKEN=...
export DATABASE_URL=postgres://...
export FRONTEND_IMAGE=ghcr.io/x-evor/dashboard:latest
ansible-playbook -i inventory.ini deploy_traffic_billing_stack.yml
Deploy only selected services
Use STACK_SERVICES with a comma-separated list:
xray-exporterbilling-serviceaccountsconsoleagent
cd /Users/shenlan/workspaces/cloud-neutral-toolkit/playbooks
export STACK_TARGET_HOST=jp-xhttp-contabo.svc.plus
export STACK_SERVICES=xray-exporter,billing-service,agent
export INTERNAL_SERVICE_TOKEN=...
export DATABASE_URL=postgres://...
ansible-playbook -i inventory.ini deploy_traffic_billing_stack.yml
Notes
accountsandconsolestill use their existing role contracts.consolerequiresFRONTEND_IMAGEbecause the target host only does pull-only compose deployment.consolenow writes a Caddy fragment named like<server-name>-<release_id>-<hostname>-<domain>.caddyinstead of managing the Caddy service container itself.billing-servicerequiresDATABASE_URL.xray-exporterandagentrequireINTERNAL_SERVICE_TOKEN.
Deploy console to a specific host and sync DNS
deploy_console_svc_plus.yml now accepts two useful overrides:
console_service_target_host: inventory host to deploy to, for examplejp_xhttp_contabo_hostconsole_service_sync_dns=true: rebuild and reconcile DNS records for that target host after deployment
Example:
cd /Users/shenlan/workspaces/cloud-neutral-toolkit/playbooks
ansible-playbook -i inventory.ini deploy_console_svc_plus.yml \
-e console_service_target_host=jp_xhttp_contabo_host \
-e console_service_sync_dns=true \
-e FRONTEND_IMAGE=ghcr.io/x-evor/dashboard:latest