Repository navigation
PLX-257: a runner host turns on its Connect server from ci/ through the Terraform modules - #94
Merged
davidjalbers merged 14 commits intoDec 3, 2026
Conversation
…s (red) The user-data of a host with it off is held byte for byte; with it on, actions_runners_connect reaches the values file as a boolean. Co-Authored-By: Claude Sonnet <noreply@anthropic.com>
connect_server travels like turbo_cache_overlay, but reaches the values file only when true, so that the user-data of every host that leaves it off is unchanged. Co-Authored-By: Claude Sonnet <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet <noreply@anthropic.com>
… usual values Co-Authored-By: Claude Sonnet <noreply@anthropic.com>
…r rule and the warning where a tenant decides (red) Co-Authored-By: Claude Sonnet <noreply@anthropic.com>
…e for a fallback, and the warning where a tenant decides The root merges a map of fallbacks under the defaults and the host; only an attribute whose fallback leaves the user-data of existing hosts byte for byte as it was may have one. The user-data module's header states the rule for what reaches the values file. Two test corrections made with this change: the header regex is case-insensitive, and a case that contradicted its own assertion is dropped. Co-Authored-By: Claude Sonnet <noreply@anthropic.com>
…ers/plx-257-connect-on-a-runner-host-by-terraform
…he lib tests see the modules; a missing provider cache says how to fill it Co-Authored-By: Claude Sonnet <noreply@anthropic.com>
… where it differs from the role's default Co-Authored-By: Claude Sonnet <noreply@anthropic.com>
…ers/plx-257-connect-on-a-runner-host-by-terraform
…ers/plx-257-connect-on-a-runner-host-by-terraform
…ers/plx-257-connect-on-a-runner-host-by-terraform
…ur codes Co-Authored-By: Claude Sonnet <noreply@anthropic.com>
…ers/plx-257-connect-on-a-runner-host-by-terraform
davidjalbers
deleted the
davidjalbers/plx-257-connect-on-a-runner-host-by-terraform
branch
December 3, 2026 04:06
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PLX-257: a tenant can state that a runner host runs a Connect server of its own (§ 7.6), per host and as a default for all hosts, from the root
ci/through both modules into the user-data.What a tenant writes
In
ci/hosts.auto.tfvars:connect_server = trueindefaultsfor every host, or in one host's entry (hosts = { "ci-1" = { connect_server = true } }); a host's own value wins.The playbook then reads the item
1password-connect(fieldscredentialsandtoken, asvars/vault.ymlalready names them) from the vault<owner>-ci-host, so the tenant creates that item first.connect_server = falsestays the default of the modules and of the template.Hosts that exist
A host that leaves it off is not replaced: the variable reaches the values file only when true (as
netbird_management_urldoes when given), so its user-data is the same text as before.This is held by a test that pins the SHA-256 of the rendered user-data for fixed variables to the value recorded on the integration branch before the change, and by a second one that the key is absent when off.
Turning it on, for a host or in the defaults, replaces the host, like any user-data change; run
ci-runner-unregisterfirst.The one place this deviates from
turbo_cache_overlay, which is always in the values file (falseincluded): copying that would change every host's user-data.A hosts file born at an earlier version has no
connect_serverin itsdefaults, andplx updatedoes not add it (the file is born once).The root therefore holds a map of fallbacks,
connect_server = false, merged underdefaultsand the host's entry, and leaves the fallback keys out of the "missing" check.Such a file plans as it is, with the same
settingsas one that statesconnect_server = false.A misspelt key or a null in
defaultsor in a host's entry is still refused by name.The rule is stated beside the map: an attribute may get a fallback only where its fallback leaves the user-data of hosts that exist byte for byte as it was.
A new repo's born file states
connect_server = false.How it was tested
terraform testin both modules (27 and 18 runs, mocked provider, no token): with it onactions_runners_connectis the booleantruein the values file and reaches the server's user-data; with it off the hash is the recorded one and the key absent; with it on the token is still the only secret and no pointer, credentials file orOP_CONNECTis in the user-data.packages/librender tests: the hosts file, the attribute list and the root's call, that the root's attributes equal the module's inputs, and the warning atconnect_server(hosts file and root).packages/lib/src/ciRoot.test.tsrenders the root, points it at copies of the workspace modules and a mocked provider (installed from the plugin cache, no network), and runsterraform test: a hosts file without the key plans, the host takes false, a host can turn it on, a typo and a null are refused by name, another missing attribute is still refused. It cannot see the module's user-data (a root test reaches module outputs only); that is held by the module test's hash.actions_runners_connect = false.mise run testexit 0.newborns/repo-operations.test.tswas edited (the plan'ssettingsfor an own and a usual value) and not run; it needs the e2e machinery.Each test commit is red first: the module tests failed on the assertion because the variable did not exist (Terraform only warns about an undeclared variable in a run block), the lib tests failed on the missing line and the old header regex.
Readings
connect_server; the playbook'sactions_runners_connectis its value key.ci-runner-slotsources/etc/ci-runner/connect.env(the token and the port) for every slot and hands the slotOP_CONNECT_TOKENandOP_CONNECT_HOST=http://127.0.0.1:<port>, which it builds itself.vaultOfinplx-ciuses Connect when both are set, startingopwithout the service account token (§ 8.1). So it works by reading, with no change toplx-ci.The variable's description says both.
Reading for the maintainer to confirm: the fallback
The alternative is the strict rule: the hosts file states every attribute, and a file born earlier needs
connect_server = falseby hand indefaults, found when someone runsplan(validatedoes not read values, so the update's pull request is green).optional(bool, false)is no way out:defaultsandhostsaretype = any, and typing them as objects would drop unknown keys and nulls without a word, so a typo would quietly give a host the default.Questions for the maintainer
These change no code here.
reposlots, against Decisions § 7.3 (areposlot never holds the deploy key), § 3.9 (the server-actions key is not in the job's environment) and § 8.4 (a job handed no token reads nothing from the vault).With Connect every slot's environment holds a token that reads all of
<owner>-ci.The role and the compendium accept this knowingly; the decisions do not say so.
Options: a Connect token per slot kind over vaults that differ; Connect only on hosts without
reposlots; or the risk accepted in the decisions in so many words.This lets a tenant turn it on for every host with one line in
defaultsbefore that trial.Should it stay per host until then, or is the opt-in enough?
connect_serveris a third.Should the decisions name it?
What the compendium owes
In
approaches/delivery.md(§ 8 PLX-Delivery):connect_serverinci/hosts.auto.tfvars, per host or indefaults;actions_runners_connectis the playbook's value (about line 353).1password-connectin<owner>-ci-host, with the fieldscredentials(the text of1password-credentials.json) andtoken; turning it on replaces the host, so runci-runner-unregisterfirst.🤖 Generated with Claude Code