Last active
May 7, 2021 13:57
-
-
Save mdbooth/2b0ad0b2d6d53080cc2b2ae5fa150ab1 to your computer and use it in GitHub Desktop.
Convert an entry in clouds.yaml to OS_* environment variables
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
#!/bin/sh | |
exec yq -r '.clouds.'$1' | |
| paths(scalars) as $p | |
| "export OS_" + ($p|last|ascii_upcase) + "=\"" + (getpath($p)|tostring) + "\""' \ | |
< ~/.config/openstack/clouds.yaml |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment