github.com/tommi2day/gomodules@v1.13.2-0.20240423190010-b7d55d252a27/test/docker/vault_provision/vault_init.sh (about)

     1  #!/bin/sh
     2  
     3  WD=$(dirname $0)
     4  # vault container has no bash
     5  set -e
     6  VAULT_ADDR="http://localhost:8200"
     7  VAULT_TOKEN=$VAULT_DEV_ROOT_TOKEN_ID
     8  export VAULT_ADDR VAULT_TOKEN
     9  
    10  echo "run provision using $VAULT_ADDR and Token $VAULT_TOKEN in $WD"
    11  # payload
    12  vault secrets enable -version=2 -path=secret kv
    13  vault secrets list
    14  
    15  # default policies
    16  vault policy write admin "$WD/admin_policy.hcl"
    17  vault policy write admin "$WD/provisioner_policy.hcl"