# No-op

The no-op modules implement all three roles of the [v1alpha1 module contract](<https://captf.io/docs/module-author/contract/v1alpha1/index.md>) and provision nothing. Every resource is a `terraform_data` holding the inputs it was given, so the plans, the state and the outputs are real while no cloud is touched and no credentials are read. Use them to try CAPTF, to test a management cluster, or as the smallest starting point for a module of your own. The images are built from [`captf-io/noop-modules`](<https://github.com/captf-io/noop-modules>), which holds the modules and is their only source.

- **Cluster**

  ---

  A stand-in load balancer, an endpoint that never resolves, one failure domain.
- **Machine**

  ---

  A stand-in instance per `Machine`, with a stable provider ID.
- **MachinePool**

  ---

  A stand-in scaling group per `MachinePool`, one provider ID per replica.

## Images

| Role | Image | Page |
| --- | --- | --- |
| cluster | `ghcr.io/captf-io/noop-cluster` | [Cluster](<https://captf.io/docs/cloud-modules/noop/cluster/index.md>) |
| machine | `ghcr.io/captf-io/noop-machine` | [Machine](<https://captf.io/docs/cloud-modules/noop/machine/index.md>) |
| machinepool | `ghcr.io/captf-io/noop-machinepool` | [MachinePool](<https://captf.io/docs/cloud-modules/noop/machinepool/index.md>) |

The images need no Terraform provider: `terraform_data` is built into Terraform and OpenTofu. They are built on the [Terraform and OpenTofu base images](<https://captf.io/docs/module-author/image-contract/index.md>), for `linux/amd64` and `linux/arm64`, with the same tags as every set (see [Images and tags](<https://captf.io/docs/cloud-modules/#images-and-tags>)). The modules need Terraform 1.5 or later; every OpenTofu release works.

## Prerequisites

- **A management cluster with CAPTF installed.** See [Install the provider](<https://captf.io/docs/getting-started/quick-start/#1-install-the-provider>).
- **An identity.** Every `TerraformCluster` names a `TerraformClusterIdentity`, even one whose modules read no credentials. The Secret behind it can hold anything: the provider’s `templates/identity.yaml` with its placeholder keys left as they are is enough.

Nothing else: no network, no node image, no cloud controller manager and no CNI.

## Quick start

Follow the [Quick Start](<https://captf.io/docs/getting-started/quick-start/index.md>), with the published images, which its third step selects. When you generate the cluster, set:

```sh
export TERRAFORM_CLUSTER_IMAGE=ghcr.io/captf-io/noop-cluster:opentofu
export TERRAFORM_MACHINE_IMAGE=ghcr.io/captf-io/noop-machine:opentofu
```

The `opentofu` tag is the newest release; pin a release tag such as `vX.Y.Z-opentofu`, or a digest, in anything you keep. The `terraform` tags run the same modules on Terraform.

## What you will see

The `TerraformCluster` and each `TerraformMachine` reach `Ready=True`, and the `Cluster` and its `Machine`s reach phase `Provisioned`: the modules return an endpoint and provider IDs. No `Machine` reaches `Running`, and `KubeadmControlPlane` never reports itself initialized, because no node ever boots or registers. The images exercise CAPTF, not Kubernetes.

> [!WARNING]
>
> **Remediation starts after about 30 minutes**
>
> No `Node` ever registers, so once a `MachineHealthCheck`’s node-startup timeout passes, Cluster API starts remediating the `Machine`s. See [Remediation](<https://captf.io/docs/user-guide/remediation/index.md>).

## Exports

The cluster role’s `exports` carry one key, `backend_id`: the id of its stand-in load balancer. The machine and machinepool roles record it in their own state, so a machine’s state holds a value that exists only after the cluster applied, as with a real set. The exports have no `schema` key.

## Tags

Each role records `captf_tags` in its resource, so the tags show in the state and the plan. There is nothing to tag.

## Writing your own

The no-op modules are the smallest modules that meet the contract, which makes them the starting point of [Your First Module](<https://captf.io/docs/getting-started/first-module/index.md>). Each role page lists the inputs it reads and the outputs it returns.
