Skip to content

Instantly share code, notes, and snippets.

@bitdivine
Created May 15, 2017 10:38
Show Gist options
  • Save bitdivine/6b7e6b1ddc513bc75b5a0273724cd40f to your computer and use it in GitHub Desktop.
Save bitdivine/6b7e6b1ddc513bc75b5a0273724cd40f to your computer and use it in GitHub Desktop.
Source an Ansible profile
# The credentials file looks like this:
# [profile-name]
# VAR_1=something
# VAR_2=else
#
# [another-profile]
# ...
source <(sed -n "/^\[${profile}\]/,/^\[/{/^[^[]/p}" ~/.aws/credentials)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment