Skip to content

Instantly share code, notes, and snippets.

@gerbal
Created May 6, 2021 19:34
Show Gist options
  • Save gerbal/3d8314fe0548465d1d49527b7964984c to your computer and use it in GitHub Desktop.
Save gerbal/3d8314fe0548465d1d49527b7964984c to your computer and use it in GitHub Desktop.
Copy vault roles between vault auth providers
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