Skip to content

Instantly share code, notes, and snippets.

@mdbooth
Last active May 7, 2021 13:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mdbooth/2b0ad0b2d6d53080cc2b2ae5fa150ab1 to your computer and use it in GitHub Desktop.
Save mdbooth/2b0ad0b2d6d53080cc2b2ae5fa150ab1 to your computer and use it in GitHub Desktop.
Convert an entry in clouds.yaml to OS_* environment variables
#!/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