Unify SSH key mount path format across all dataplane services #1752
+261
−243
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.
Previously, the SSH key mount path differed between global services (DeployOnAllNodeSets=true) and non-global services:
The non-global services path happened to work because ansible-runner has a built-in mechanism that looks for an SSH key at /runner/env/ssh_key and automatically loads it into ssh-agent. However, this relied on ansible-runner's implicit behavior rather than the explicit ansible_ssh_private_key_file variable set in the inventory.
The inventory always sets ansible_ssh_private_key_file to /runner/env/ssh_key/ssh_key_ regardless of service type (see inventory.go line 178). This inconsistency meant non-global services were mounting the SSH key at a different path than what Ansible expected from the inventory variable, relying on ansible-runner's fallback behavior. However, there were errors in ansible logs as there were no files in /runner/env/ssh_key/ssh_key_ which was confusing to users.
This change unifies the SSH key mount path to always use the format:
/runner/env/ssh_key/ssh_key_< nodesetname >
This ensures:
For global services, multiple SSH keys are mounted (one per nodeset) in the ssh_key folder. For non-global services, only the matching nodeset's key is mounted, but at the same path format.
Assisted-by: Claude-4.5-opus