Skip to content

Move host-level configuration to triangle-infrastructure - #221

Merged
ssavutu merged 3 commits into
mainfrom
chore/split-out-infrastructure
Aug 24, 2026
Merged

Move host-level configuration to triangle-infrastructure#221
ssavutu merged 3 commits into
mainfrom
chore/split-out-infrastructure

Conversation

@ssavutu

@ssavutu ssavutu commented Aug 23, 2026

Copy link
Copy Markdown
Member

Splits server configuration out of this repo and into
DrexelTriangle/triangle-infrastructure
(private), where it is applied with Ansible instead of copied over SCP.

Draft: do not merge until Delta is adopted

Merging this is safe for deploys — the workflow step that read the removed
files is removed in the same commit, so Deploy Delta will not break.

What it does mean is that Delta's observability stack stops being updated by
anything. It keeps running on restart: unless-stopped, but a config change
would no longer reach it. Order:

  1. Run playbooks/observability.yml --check --diff against Delta, then for real.
  2. Confirm the stack is healthy and both nginx endpoints still answer.
  3. Merge this.

Steps 1–2 have not been done. Everything else here has no live coupling —
nothing reads deploy/mariadb/, deploy/maxscale/, deploy/proxmox/ or
deploy/nginx/triangle-cms.conf at deploy time.

The boundary

Infrastructure is what gets applied to a machine and survives a
docker compose down. Application is what is built and shipped per release.
This repo keeps compose.cms.yml, the blue/green deploy and rollback scripts,
common.sh, all three Dockerfiles, the container-internal
frontend/nginx.conf, the active-upstream seed file, the env templates and
every workflow.

There is a third category with no owner: runtime state.
/etc/nginx/triangle-cms/active-upstreams.conf is written by deploy.sh and
read back to determine the live slot, so its correct contents are unknowable
from any git tree. Ansible manages the directory and never the file; the role
has a guard task that fails the run if that file ever appears in it.

Moved

From To
deploy/mariadb/ roles/mariadb_{primary,replica}/
deploy/maxscale/ roles/maxscale/
deploy/proxmox/ roles/proxmox_ip_watch/
deploy/nginx/triangle-cms.conf roles/delta_cms_host/files/
deploy/nginx/triangle-{loki,prometheus}.conf roles/observability/files/nginx/
deploy/compose.observability.yml roles/observability/files/
deploy/scripts/deploy-observability.sh roles/observability/files/scripts/
observability/ except prometheus.dev.yml roles/observability/files/observability/
observability/grafana/dashboards/ grafana/dashboards/
scripts/pull-dashboards.sh grafana/

Two changes that are not just file moves

The dev stack loses Loki, Promtail and Grafana. loki-config.yml and
promtail-config.yml were mounted by both the repo-root docker-compose.yml
and Delta's compose.observability.yml. Keeping a copy here would have meant
two sources of truth for the production log pipeline with nothing to catch
drift. Dev keeps Prometheus; docker compose logs covers the rest.

deploy-observability.sh is now self-contained. It used to
source deploy/scripts/common.sh for nginx_test and nginx_reload — the only
two functions it took. Those are duplicated into the infra repo as
lib-nginx.sh, minus common.sh's DEPLOY_TEST_MODE hooks, which stay here
with the test harness that uses them.

Verification

  • deploy/scripts/deploy_scripts_test.sh passes.
    test_host_nginx_health_uses_default_type moved to the infra repo's
    tests/site-contracts.sh with the file it asserts on — leaving it here would
    have tested whichever stale copy was on the runner.
  • go build ./... clean; docker compose config valid.
  • Every role in the new repo was dry-run against its real host.
    delta_cms_host, both mariadb roles and maxscale all report
    changed=0. That gate is what proves the roles describe the servers as they
    actually are rather than as the repo assumed.

Known follow-up

.gitignore still says "see deploy/mariadb/README.md" for the .webhook
entry. Left alone deliberately — there is an unrelated uncommitted change in
that file on this working tree.

🤖 Generated with Claude Code

ssavutu and others added 3 commits August 23, 2026 02:27
Server configuration that is applied to a machine, rather than built and
shipped with a release, now lives in DrexelTriangle/triangle-infrastructure as
Ansible roles. This repo keeps everything that versions with the application:
compose.cms.yml, the blue/green deploy and rollback scripts, the Dockerfiles,
the container-internal frontend/nginx.conf, and the workflows.

Moved: deploy/mariadb/, deploy/maxscale/, deploy/proxmox/,
deploy/nginx/triangle-cms.conf, deploy/nginx/triangle-{loki,prometheus}.conf,
deploy/compose.observability.yml, deploy/scripts/deploy-observability.sh,
scripts/pull-dashboards.sh, and observability/ except prometheus.dev.yml.

The dev stack loses Loki, Promtail and Grafana. loki-config.yml and
promtail-config.yml were mounted by both the dev compose file and Delta's, so
keeping a copy here would have meant two sources of truth for the production
log pipeline with nothing to catch drift between them. Dev keeps Prometheus;
use `docker compose logs` for the rest.

The Deploy Delta workflow no longer runs deploy-observability.sh. That step
read observability/ out of the runner's checkout, so leaving it in place would
fail every deploy once these files are gone.

test_host_nginx_health_uses_default_type moved to the infrastructure repo's
tests/site-contracts.sh along with the file it asserts on. The remaining deploy
script tests pass unchanged.

Before merging, see the ordering note in the PR: Delta's observability stack
keeps running on restart:unless-stopped, but nothing updates it until
playbooks/observability.yml has been applied.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Follow-up to moving host config into triangle-infrastructure:

- Retarget comments that pointed at moved files (deploy/nginx/triangle-cms.conf,
  prometheus.delta.yml, the Grafana dashboard) to say the host Nginx site and
  those configs now live in triangle-infrastructure. Touches clipboard.ts,
  homepage_carousel_settings.go, compose.cms.yml and prometheus.dev.yml.
- Drop dead .gitignore entries: `.webhook` (its comment pointed at the
  now-moved deploy/mariadb/README.md, and nothing in this repo uses the file)
  and `deploy/runner/` (unreferenced; the runner lives on the host). Kept the
  db-backups and deploy/*.env rules.

Comment/ignore-only; no behaviour change. go build and the dev prometheus
config still validate.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The infra split moved Loki, Promtail, Grafana, Alertmanager, blackbox and the
Delta scrape config to triangle-infrastructure, and removed Loki/Promtail/
Grafana from the dev stack. That left a lone dev Prometheus scraping the local
CMS with nothing to visualise it (dev Grafana is gone) and nothing in CI, tests
or scripts depending on it -- a scraper with no consumer.

Removed the dev prometheus service and its volume from docker-compose.yml and
deleted observability/prometheus/prometheus.dev.yml, so observability/ no longer
exists in this repo. The backend still exposes GET /metrics; scrape it directly
in local dev if needed. Updated the README and setup_containers messaging.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@ssavutu
ssavutu marked this pull request as ready for review August 24, 2026 01:42
@ssavutu
ssavutu merged commit ebb1c6d into main Aug 24, 2026
7 checks passed
@ssavutu
ssavutu deleted the chore/split-out-infrastructure branch August 24, 2026 01:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant