Browse Source

Add support for vault kv v2 api, key off of VAULT_KV_V2 env var

pull/2393/head
Sean Brandt 6 years ago
parent
commit
f446a6c9ec
  1. 9
      deploy/vault_cli.sh

9
deploy/vault_cli.sh

@ -2,10 +2,10 @@
# Here is a script to deploy cert to hashicorp vault
# (https://www.vaultproject.io/)
#
#
# it requires the vault binary to be available in PATH, and the following
# environment variables:
#
#
# VAULT_PREFIX - this contains the prefix path in vault
# VAULT_ADDR - vault requires this to find your vault server
#
@ -51,6 +51,11 @@ vault_cli_deploy() {
if [ -n "$FABIO" ]; then
$VAULT_CMD write "${VAULT_PREFIX}/${_cdomain}" cert=@"$_cfullchain" key=@"$_ckey" || return 1
elif [ -n "$VAULT_KV_V2" ]; then
$VAULT_CMD kv put "${VAULT_PREFIX}/${_cdomain}" cert=@"$_ccert" \
key=@"$_ckey" \
chain=@"$_cca" \
fullchain=@"$_cfullchain" || return 1
else
$VAULT_CMD write "${VAULT_PREFIX}/${_cdomain}/cert.pem" value=@"$_ccert" || return 1
$VAULT_CMD write "${VAULT_PREFIX}/${_cdomain}/cert.key" value=@"$_ckey" || return 1

Loading…
Cancel
Save