From f7dd67818a235be9a28c2eb36912678fc4c53787 Mon Sep 17 00:00:00 2001 From: Andrew Womeldorf Date: Sat, 11 Jul 2020 09:19:21 -0500 Subject: [PATCH 1/2] Run-vault submodule: add flag `--data-dir` As per Issue #202, the Vault data directory is not able to be set when calling the `run-vault` script. It's automatically set to `../data`, relative to where the script is run. This commit adds a flag to set the data directory. --- modules/run-vault/run-vault | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/modules/run-vault/run-vault b/modules/run-vault/run-vault index f012ff40..1598edd2 100755 --- a/modules/run-vault/run-vault +++ b/modules/run-vault/run-vault @@ -34,6 +34,7 @@ function print_usage { echo -e " --api-addr\t\tThe full address to use for Client Redirection when running Vault in HA mode. Defaults to \"https://[instance_ip]:$DEFAULT_PORT\". Optional." echo -e " --config-dir\t\tThe path to the Vault config folder. Optional. Default is the absolute path of '../config', relative to this script." echo -e " --bin-dir\t\tThe path to the folder with Vault binary. Optional. Default is the absolute path of the parent folder of this script." + echo -e " --data-dir\t\tThe path to the Vault data folder. Optional. Default is the absolute path of '../data', relative to this script.." echo -e " --log-level\t\tThe log verbosity to use with Vault. Optional. Default is $DEFAULT_LOG_LEVEL." echo -e " --systemd-stdout\t\tThe StandardOutput option of the systemd unit. Optional. If not configured, uses systemd's default (journal)." echo -e " --systemd-stderr\t\tThe StandardError option of the systemd unit. Optional. If not configured, uses systemd's default (inherit)." @@ -438,6 +439,7 @@ function run { local api_addr="" local config_dir="" local bin_dir="" + local data_dir="" local log_level="$DEFAULT_LOG_LEVEL" local systemd_stdout="" local systemd_stderr="" @@ -502,6 +504,11 @@ function run { bin_dir="$2" shift ;; + --data-dir) + assert_not_empty "$key" "$2" + data_dir="$2" + shift + ;; --log-level) assert_not_empty "$key" "$2" log_level="$2" From 6fc394a3e63004f47187502c8e6b98e31b0d6b34 Mon Sep 17 00:00:00 2001 From: Andrew Womeldorf Date: Mon, 13 Jul 2020 09:05:23 -0500 Subject: [PATCH 2/2] Update modules/run-vault/run-vault typo Co-authored-by: Yevgeniy Brikman --- modules/run-vault/run-vault | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/run-vault/run-vault b/modules/run-vault/run-vault index 1598edd2..c7982409 100755 --- a/modules/run-vault/run-vault +++ b/modules/run-vault/run-vault @@ -34,7 +34,7 @@ function print_usage { echo -e " --api-addr\t\tThe full address to use for Client Redirection when running Vault in HA mode. Defaults to \"https://[instance_ip]:$DEFAULT_PORT\". Optional." echo -e " --config-dir\t\tThe path to the Vault config folder. Optional. Default is the absolute path of '../config', relative to this script." echo -e " --bin-dir\t\tThe path to the folder with Vault binary. Optional. Default is the absolute path of the parent folder of this script." - echo -e " --data-dir\t\tThe path to the Vault data folder. Optional. Default is the absolute path of '../data', relative to this script.." + echo -e " --data-dir\t\tThe path to the Vault data folder. Optional. Default is the absolute path of '../data', relative to this script." echo -e " --log-level\t\tThe log verbosity to use with Vault. Optional. Default is $DEFAULT_LOG_LEVEL." echo -e " --systemd-stdout\t\tThe StandardOutput option of the systemd unit. Optional. If not configured, uses systemd's default (journal)." echo -e " --systemd-stderr\t\tThe StandardError option of the systemd unit. Optional. If not configured, uses systemd's default (inherit)."