Package org.kiwiproject.ansible.vault
Class VaultConfiguration
- java.lang.Object
-
- org.kiwiproject.ansible.vault.VaultConfiguration
-
public class VaultConfiguration extends Object
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.
-
-
Constructor Summary
Constructors Constructor Description VaultConfiguration()No-arg constructor.VaultConfiguration(String ansibleVaultPath, String vaultPasswordFilePath, String tempDirectory)All-args constructor.
-
-
-
Constructor Detail
-
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 Detail
-
copyOf
public VaultConfiguration copyOf()
Makes a copy of this instance.- Returns:
- a new instance containing the same values as this instance
-
-