Class 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 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.tmpdir system property.

      • VaultConfiguration

        public VaultConfiguration​(String ansibleVaultPath,
                                  String vaultPasswordFilePath,
                                  String tempDirectory)
        All-args constructor.

        If tempDirectory is blank, the temporary directory will be set to the value of the running JVM's java.io.tmpdir system property.

        Parameters:
        ansibleVaultPath - path to the ansible-vault executable
        vaultPasswordFilePath - path to the vault password file for encryption
        tempDirectory - a temporary directory used with the encrypt_string command
        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