Consider moving test code to find ansible-vault (or any) executable to production code #944
Closed
sleberknight
started this conversation in
Ideas
Replies: 1 comment
-
Created issues: |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
The
VaultEncryptionHelperIntegrationTest
contains code that finds the location of theansible-vault
executable usingwhich
. If it does not find it, then it falls back to "well known" locations for macOS (assuming Homebrew installation) and Linux.In our new environments,
ansible-vault
is installed via pip, so the location is~/.pip/bin/ansible-vault
. Our existing service code (and specifically the "core service" library) assumes the standard Linux location of/usr/bin/ansible-vault
, so the code obviously fails.Instead, it would be better to use the strategy used in the test, i.e. first try finding it via
which
and then maybe falling back based on OS like the test does. This could be a static method inVaultEncryptionHelper
or maybe inVaultConfiguration
.Further, since using
which
is a generic thing, maybe we add awhich(String command)
method toProcesses
and/orProcessHelper
first, and then add a method inVaultConfiguration
to get the path ofansible-vault
. e.g.Beta Was this translation helpful? Give feedback.
All reactions