playbook: deploy tysm canary configs from templates - #183
Open
parithosh wants to merge 2 commits into
Open
Conversation
The tysm beacon canary on glamsterdam-devnet-7 had its hook + xatu config files hand-copied into the prysm datadir because no play pushed them, so every new canary host crash-looped on missing files until someone ran an ad-hoc copy. Backport the fix: jinja2 templates keyed on inventory_hostname, ansible_host and the ethereum_node_cl/el vars, rendered into the prysm datadir by a tysm_enabled-gated play that runs before the ethereum_node role starts the container. The flag defaults to false, so nothing changes unless a host opts in via host_vars. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
barnabasbusa
reviewed
Aug 3, 2026
Replace the tysm_enabled host_vars flag with a tysm group wired through the stack: a per-node "tysm = true" flag in nodes.tf propagates as a tysm:<network> tag/label, the inventory template renders a [tysm] group from it (always present, empty by default), and a group-scoped firewall opens the 8675 control port on just those instances. The playbook play now targets hosts: tysm instead of gating on the var, so membership lives in one place — the terraform node definition. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
Split out of #180 per review feedback (it mixed concerns with the backport batch).
What
On glamsterdam-devnet-7 the tysm beacon canary's hook + xatu config files were hand-copied into the prysm datadir — the prysm role has no file-push task (ethpandaops/glamsterdam-devnets@25695b9 notes this) — so every new canary host crash-looped on missing files until someone ran an ad-hoc copy.
This backports the generic mechanism, driven by a dedicated tysm inventory group (empty by default in the template):
terraform nodes.tf— node entries take an optionaltysm = trueflag. It propagates as atysm:<network>tag (DigitalOcean) / label (Hetzner) on the instances, mirroring howsupernodeandbuilder_indexflow today.ansible_inventory.tmpl/outputs.tf— the tag surfaces as a per-host attribute and renders a[tysm]group in the generated inventory. The group header is always emitted so the playbook play resolves; it's just empty until a node opts in.firewall.tf— newtysmfirewalls (DO + Hetzner) open the 8675 control API port (bad-tysm dials back on it) scoped to tagged instances only, unlike the fleet-wide rule on glamsterdam. Created only when at least one tysm node exists.inventories/devnet-0/templates/tysm/*.j2— hook + xatu configs templatized on existing vars:inventory_hostname(instance/pod/node names),ansible_host(theself_urlIP bad-tysm dials back to),ethereum_node_cl/ethereum_node_el(labels),ethereum_network_name(namespace).${TYSM_TOKEN}placeholders resolve from container env at load, not from Ansible.playbook.yaml— targetshosts: tysm(no moretysm_enabledhost_vars flag), placed before theethereum_noderole play so the files exist before first container boot. Creates the prysm user/datadir mirroring the role's ownership and renders both files into the datadir, which the existing mount surfaces at/datain the container. Tagged[ethereum, ethereum_node, tysm].The group is empty in the template, so forks see no behavior change unless a node entry opts in via
tysm = true. Live equivalent: ethpandaops/glamsterdam-devnets#58.Verification
terraform validatepasses andterraform fmt --recursive --check(the CI lint) is clean.ansible_inventory.tmplviatemplatefile()with mock hosts (one tysm-tagged, two not):[tysm]contains exactly the tagged host; with no tagged hosts the group renders empty but present.ansible-playbook --list-tasksagainst that rendered inventory: the tysm play targets thetysmgroup with the three deploy tasks, ordered before theethereum_noderole play, matching under-t ethereum,-t ethereum_nodeand-t tysm.ansible-lint --profile production+ the workflow skip-list): no new violations. The 4 failures CI reports at the "Refresh inventory web" play are pre-existing on master (#noqavs# noqa:syntax) and are fixed by backport generic improvements from glamsterdam-devnets and bal-devnets #180 — this PR goes green once that merges.🤖 Generated with Claude Code