Created
May 6, 2021 19:34
-
-
Save gerbal/3d8314fe0548465d1d49527b7964984c to your computer and use it in GitHub Desktop.
Copy vault roles between vault auth providers
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
first_auth=kubernetes | |
second_auth=kubernetes_two | |
roles=$(VAULT_FORMAT=json vault list "auth/$first_auth/role" | jq -r ".[]") | |
for role in $roles; do | |
vault read "auth/$first_auth/role/$role" -format=json | jq '.data' | vault write "auth/$second_auth/role/$role" - | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment