Skip to content

manager: make operator key reachable in seed#2917

Merged
berendt merged 1 commit into
mainfrom
fix-operator-key-in-seed-mount
Jun 29, 2026
Merged

manager: make operator key reachable in seed#2917
berendt merged 1 commit into
mainfrom
fix-operator-key-in-seed-mount

Conversation

@ideaship

Copy link
Copy Markdown
Contributor

What

Make the operator private key reachable inside the osism/seed container
during osism update manager, by placing it in the bind-mounted
configuration directory and reading it from there.

Why

osism update manager runs the keypair play inside the osism/seed
container (the default CONTAINER=auto path on a manager). That container
bind-mounts only /opt/configuration, but environments/secrets.yml
resolved operator_private_key from host paths outside the mount
(/home/dragon/.ssh/id_rsa, /ansible/secrets/id_rsa.operator). Inside
the container the lookup resolved to an empty string, so the keypair play
wrote a zero-byte id_rsa.operator and the manager apply failed with an
opaque SSH error:

Load key ".../id_rsa.operator": error in libcrypto: unsupported
... Permission denied (publickey).

This broke the midnight upgrade/update lanes (all three failed identically
once the seed-container update path became active).

How

  • scripts/deploy/000-manager.sh copies /home/dragon/.ssh/id_rsa to
    /opt/configuration/environments/secrets/id_rsa.operator after the repo
    is synced into /opt/configuration, alongside the existing public-key
    copy.
  • environments/secrets.yml looks up that in-mount path first, keeping the
    two host paths as fallbacks so managers deployed before this change still
    work.

configuration_directory is /opt/configuration both on the manager host
and as the seed bind-mount, so the absolute path resolves in the seed
container and in the venv/on-manager contexts alike.
environments/secrets/ is already gitignored, so the key never lands in
git.

This keeps the testbed's existing design (dynamic Nova keypair,
lookup-based operator_private_key); it deliberately does not adopt the
production vault-literal model (that is tbng's role).

Testing

Integration test in the osism/seed container against a simulated
/opt/configuration mount:

yamllint (repo config) and shellcheck clean. A full deploy + upgrade on
a real testbed has not been run.

Related

🤖 Generated with Claude Code

osism update manager runs the keypair play inside the osism/seed
container (the default CONTAINER=auto path on a manager). That container
bind-mounts only /opt/configuration, but environments/secrets.yml
resolved operator_private_key from host paths outside the mount
(/home/dragon/.ssh/id_rsa, /ansible/secrets/id_rsa.operator). Inside the
container the lookup resolved to an empty string, the keypair play wrote
a zero-byte id_rsa.operator, and the subsequent manager apply failed with
an opaque SSH error:

  Load key ".../id_rsa.operator": error in libcrypto: unsupported
  ... Permission denied (publickey).

Place a copy of the dynamic operator key inside the bind-mounted
configuration directory and read it from there:

* 000-manager.sh copies /home/dragon/.ssh/id_rsa to
  /opt/configuration/environments/secrets/id_rsa.operator after the repo
  has been synced into /opt/configuration, alongside the existing public
  key copy.
* secrets.yml looks up that in-mount path first, keeping the two host
  paths as fallbacks so managers deployed before this change still work.

configuration_directory is /opt/configuration both on the manager host
and as the seed bind-mount, so the absolute path resolves in the seed
container and in the venv/on-manager contexts alike.
environments/secrets/ is already gitignored, so the key never lands in
git.

This keeps the testbed's existing design (dynamic Nova keypair, lookup
based operator_private_key); it does not adopt the production vault-literal
model.

Assisted-by: Claude:claude-opus-4-8
Signed-off-by: Roger Luethi <luethi@osism.tech>
@ideaship ideaship marked this pull request as ready for review June 29, 2026 09:25
@ideaship ideaship requested a review from berendt June 29, 2026 09:25
@berendt berendt merged commit 5753c7d into main Jun 29, 2026
3 checks passed
@berendt berendt deleted the fix-operator-key-in-seed-mount branch June 29, 2026 16:23
@github-project-automation github-project-automation Bot moved this from Ready to Done in Human Board Jun 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants