vault standalone script generate a root keys

This commit is contained in:
vincent 2022-11-06 17:08:46 +01:00
parent 515e14367b
commit 9fe27b845c

View File

@ -28,4 +28,7 @@ EOF
echo "starting vault server please unseal before use "
nohup vault server -config "/tmp/standalone-vault-dev.hcl" &
vault token create -policy=$ANSIBLE_POLICY -display-name=rebuild-token
vault operator unseal
OTP=$(vault operator generate-root -init|grep "OTP"|head -1|awk '{print $2}')
ENCODE_ROOT=$(vault operator generate-root|tail -1|awk '{print $3}')
vault operator generate-root -decode=$ENCODE_ROOT -otp=$OTP