Skip to content

Instantly share code, notes, and snippets.

@sferich888
Created November 13, 2015 16:25
Show Gist options
  • Save sferich888/0ccd884552baaae74278 to your computer and use it in GitHub Desktop.
Save sferich888/0ccd884552baaae74278 to your computer and use it in GitHub Desktop.
Keystonerc for multple users. It allows multiple users to have the same keystonerc and prompt them for there password just like you would if you used the UI.
unset OS_SERVICE_TOKEN
if [[ -z $1 ]]; then
echo -n "Please enter your OpenStack Username: "
read OS_USERNAME_INPUT
export OS_USERNAME=$OS_USERNAME_INPUT
else
export OS_USERNAME=$1
fi
if [[ -z $2 ]]; then
echo -n "Please enter your OpenStack Tenant: "
read OS_TENANT_INPUT
export OS_TENANT_NAME=$OS_TENANT_INPUT
else
export OS_TENANT_NAME=$2
fi
echo -n "Please enter your OpenStack Password: "
read -s OS_PASSWORD_INPUT
export OS_PASSWORD=$OS_PASSWORD_INPUT
echo
export OS_REGION_NAME=RegionOne
export OS_AUTH_URL=http://10.10.73.4:5000/v2.0
export PS1='[\u@\h \W(keystone_$OS_USERNAME|$OS_TENANT_NAME)]\$ '
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment