manager: make operator key reachable in seed#2917
Merged
Merged
Conversation
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>
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.
What
Make the operator private key reachable inside the
osism/seedcontainerduring
osism update manager, by placing it in the bind-mountedconfiguration directory and reading it from there.
Why
osism update managerruns the keypair play inside theosism/seedcontainer (the default
CONTAINER=autopath on a manager). That containerbind-mounts only
/opt/configuration, butenvironments/secrets.ymlresolved
operator_private_keyfrom host paths outside the mount(
/home/dragon/.ssh/id_rsa,/ansible/secrets/id_rsa.operator). Insidethe container the lookup resolved to an empty string, so the keypair play
wrote a zero-byte
id_rsa.operatorand the manager apply failed with anopaque SSH error:
This broke the midnight upgrade/update lanes (all three failed identically
once the seed-container update path became active).
How
scripts/deploy/000-manager.shcopies/home/dragon/.ssh/id_rsato/opt/configuration/environments/secrets/id_rsa.operatorafter the repois synced into
/opt/configuration, alongside the existing public-keycopy.
environments/secrets.ymllooks up that in-mount path first, keeping thetwo host paths as fallbacks so managers deployed before this change still
work.
configuration_directoryis/opt/configurationboth on the manager hostand 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 ingit.
This keeps the testbed's existing design (dynamic Nova keypair,
lookup-based
operator_private_key); it deliberately does not adopt theproduction vault-literal model (that is tbng's role).
Testing
Integration test in the
osism/seedcontainer against a simulated/opt/configurationmount:loadable
id_rsa.operator(ssh-keygen -ysucceeds)the empty-key guard in keypair: fail on empty operator private key ansible-playbooks-manager#52
yamllint(repo config) andshellcheckclean. A full deploy + upgrade ona real testbed has not been run.
Related
🤖 Generated with Claude Code