Add methods in Ansible Vault utilities to find the ansible-vault executable #946
Labels
new feature
A new feature such as a new class, method, package, group of classes, etc.
Milestone
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
. For example,These should be implemented using the
which
method which will be added to the kiwi process-related utilities in #945.Other considerations include:
VaultConfiguration
,VaultEncryptionHelper
, or somewhere else?ProcessHelper
?VaultEncryptionHelperIntegrationTest
assumes Homebrew-based installation on macOS (and the location is pre-Silicon so/usr/local
instead of/opt/homebrew
), and assumes/usr/bin
on Linux.String
or as aSupplier<String>
, or bothThis originated from discussion #944
The text was updated successfully, but these errors were encountered: