Skip to content

Infrastructure ownership and IaC

Opfield owns the service layer: Nodes, Routes, certificates, workloads, databases, backups, monitoring, and permissions. The layers under it, provider accounts, networks, and the host operating system, are created by hand, by Terraform, OpenTofu, or Ansible, or by Opfield itself through a hosting-provider integration.

The simple rule is: one resource, one owner. Two systems can observe the same resource, but they should not both continuously rewrite it.

Layer Typical owner Examples
Provider foundation Terraform, OpenTofu, cloud console, or Opfield hosting integrations networks, virtual machines, firewalls, DNS zones, backup destinations
Host baseline Ansible, image pipeline, or host team operating system, users, kernel policy, Docker installation, disks, endpoint security
Service layer Opfield Nodes, routes, certificates, workloads, Compose projects, managed databases and storage, bindings, backups, metrics, logs, alerts, permissions, operational history
Application release intent source control and Opfield repository revision, build, artifact, deployment, rollback
Off-site copies storage outside the installation off-site backup copies; a SIEM when your compliance rules require audit retention outside Opfield

A small team creates hosts by hand or through a hosting integration and lets Opfield own everything above the operating system. A larger organization creates hosts with Terraform and enrolls each one after its security checks pass.

Before bringing an existing resource into Opfield, record:

  1. which system is allowed to change it;
  2. which system is only allowed to observe it;
  3. where its source of truth lives;
  4. who approves emergency changes;
  5. how an emergency change is reconciled afterwards.

For example, if Terraform owns a DNS record, do not also configure Opfield to continually rewrite that same record. Either keep DNS in Terraform and point it at an Opfield-managed route, or deliberately transfer that record’s lifecycle to Opfield and remove it from Terraform state.

Split ownership creates drift: one tool applies a valid change, another sees an unexpected value and changes it back. The result may look random even though both systems behave as configured.

Common conflicts include:

  • Terraform and Opfield both managing one DNS record;
  • Ansible and Opfield both replacing the same nginx configuration;
  • a host script restarting or deleting containers owned by an Opfield Deployment or Compose Project;
  • an external database tool changing users created for an Opfield-managed binding;
  • a CI pipeline deploying the same workload that Opfield also builds and deploys.

If two systems must touch one area, divide it by an explicit boundary. Terraform can own the VM and firewall while Opfield owns applications inside that VM. Ansible can own Docker installation while Opfield owns Docker resources. An external backup system can read a database while Opfield owns its service lifecycle.

During an incident, a direct host change may be the safest action. Treat it as a temporary exception:

  1. record the resource, command or setting, operator, time, and reason;
  2. pause the automation that could overwrite the change;
  3. restore customer service and preserve evidence;
  4. decide whether Opfield or the external source of truth should adopt the new state;
  5. reconcile deliberately and remove the temporary exception.

Do not leave a successful emergency fix as undocumented permanent drift. The next routine deployment may otherwise undo it.

Move one resource family at a time: ingress, workloads, databases, backups, monitoring. For each one, transfer ownership explicitly, remove it from the old tool, and prove its restore path before the next. Move your stack to Opfield gives the order and the check for each step.