Skip to content

Instantly share code, notes, and snippets.

@haneefs
Last active August 29, 2015 14:10
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 haneefs/6aab205688cc2159f302 to your computer and use it in GitHub Desktop.
Save haneefs/6aab205688cc2159f302 to your computer and use it in GitHub Desktop.
#Create couple of roles
openstack --os-url http://localhost:35357/v3 --os-identity-api-version 3 --os-token=ADMIN role create domain_admin
openstack --os-url http://localhost:35357/v3 --os-identity-api-version 3 --os-token=ADMIN role create project_admin
openstack --os-url http://localhost:35357/v3 --os-identity-api-version 3 --os-token=ADMIN role create project_user
openstack --os-url http://localhost:35357/v3 --os-identity-api-version 3 --os-token=ADMIN role create domain_user
openstack --os-url http://localhost:35357/v3 --os-identity-api-version 3 --os-token=ADMIN role create cloud_admin
openstack --os-url http://localhost:35357/v3 --os-identity-api-version 3 --os-token=ADMIN role create admin
#Create a domain
openstack --os-url http://localhost:35357/v3 --os-identity-api-version 3 --os-token=ADMIN domain create domain_A
#Create users
openstack --os-url http://localhost:35357/v3 --os-identity-api-version 3 --os-token=ADMIN user create user_AU1 --domain domain_A --password password
openstack --os-url http://localhost:35357/v3 --os-identity-api-version 3 --os-token=ADMIN user create user_AU2 --domain domain_A --password password
#Create project
openstack --os-url http://localhost:35357/v3 --os-identity-api-version 3 --os-token=ADMIN project create project_AP1 --domain domain_A
openstack --os-url http://localhost:35357/v3 --os-identity-api-version 3 --os-token=ADMIN project create project_AP2 --domain domain_A
# Use user_id for --user as this openstack client is buggy. If you have two users with same name in two different domain then the following
# command won't work. user_id will work. Same comment is also applicable for projects.
#Assign domain roles
openstack --os-url http://localhost:35357/v3 --os-identity-api-version 3 --os-token=ADMIN role add --user user_AU1 --domain domain_A domain_admin
openstack --os-url http://localhost:35357/v3 --os-identity-api-version 3 --os-token=ADMIN role add --user user_AU2 --domain domain_A domain_user
#Assign project roles
openstack --os-url http://localhost:35357/v3 --os-identity-api-version 3 --os-token=ADMIN role add --user user_AU1 --project project_AP1 project_admin
openstack --os-url http://localhost:35357/v3 --os-identity-api-version 3 --os-token=ADMIN role add --user user_AU2 --project project_AP2 project_user
#Get a token
openstack --os-auth-url http://localhost:35357/v3 --os-identity-api-version 3 --os-username user_AU1 --os-user-domain-name domain_A --os-project-name project_AP1 --os-project-domain-name domain_A --os-password password token issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment