Package org.kiwiproject.ansible.vault
Class VaultConfiguration
java.lang.Object
org.kiwiproject.ansible.vault.VaultConfiguration
Configuration class for creating ansible-vault commands. Can be constructed via the no-arg constructor, the all-args
constructor, or the builder. The builder is the preferred way to create an instance if done programmatically.
This is mutable in case it is used in injected configuration, e.g. in a Dropwizard configuration file.
Has beans validation annotations to support validation of external configuration, e.g. by Dropwizard's normal validation. But also uses explicit validation in the all-args constructor used for the Lombok builder so that invalid configurations cannot be constructed via the builder.
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionNo-arg constructor.VaultConfiguration(String ansibleVaultPath, String vaultPasswordFilePath, String tempDirectory) All-args constructor. -
Method Summary
Modifier and TypeMethodDescriptionbuilder()copyOf()Makes a copy of this instance.Path to the ansible-vault executable.A temporary directory that is used to store encrypted content when decrypting string variables via theansible-vault encrypt_stringcommand.Path to the file containing passwords to use when encrypting and decrypting with ansible-vault.voidsetAnsibleVaultPath(String ansibleVaultPath) Path to the ansible-vault executable.voidsetTempDirectory(String tempDirectory) A temporary directory that is used to store encrypted content when decrypting string variables via theansible-vault encrypt_stringcommand.voidsetVaultPasswordFilePath(String vaultPasswordFilePath) Path to the file containing passwords to use when encrypting and decrypting with ansible-vault.
-
Constructor Details
-
VaultConfiguration
public VaultConfiguration()No-arg constructor. Useful mainly when using an external configuration mechanism that uses setter methods.Sets the temporary directory to the value of the running JVM's
java.io.tmpdirsystem property. -
VaultConfiguration
public VaultConfiguration(String ansibleVaultPath, String vaultPasswordFilePath, String tempDirectory) All-args constructor.If
tempDirectoryis blank, the temporary directory will be set to the value of the running JVM'sjava.io.tmpdirsystem property.- Parameters:
ansibleVaultPath- path to the ansible-vault executablevaultPasswordFilePath- path to the vault password file for encryptiontempDirectory- a temporary directory used with theencrypt_stringcommand- Implementation Note:
- This constructor is used by the Lombok-generated builder, and therefore both this constructor and the builder perform validation on the arguments.
-
-
Method Details
-
copyOf
Makes a copy of this instance.- Returns:
- a new instance containing the same values as this instance
-
builder
-
getAnsibleVaultPath
Path to the ansible-vault executable. -
getVaultPasswordFilePath
Path to the file containing passwords to use when encrypting and decrypting with ansible-vault. -
getTempDirectory
A temporary directory that is used to store encrypted content when decrypting string variables via theansible-vault encrypt_stringcommand. -
setAnsibleVaultPath
Path to the ansible-vault executable. -
setVaultPasswordFilePath
Path to the file containing passwords to use when encrypting and decrypting with ansible-vault. -
setTempDirectory
A temporary directory that is used to store encrypted content when decrypting string variables via theansible-vault encrypt_stringcommand.
-