Adding an admin member to a domain using rhc
Consider a situation where a new system administrator joins your team. As the new system admin is also responsible for making sure your production apps are running smoothly, you would like to add the new system admin as an administrator. You can do this by giving the new user an admin role.
Getting ready
To complete this recipe, you will need to have rhc installed on your machine. Please refer to the Installing the OpenShift rhc command-line client recipe in Chapter 1, Getting Started with OpenShift, for instructions.
You will need two OpenShift accounts to work through this recipe. Please refer to the Creating an OpenShift Online account recipe in Chapter 1, Getting Started with OpenShift, for OpenShift account registration instructions.
How to do it…
To add the openshift.cookbook.test@gmail.com
user as an administrator to prodosbook
of the command:
$ rhc add-member openshift.cookbook.test@gmail.com --namespace osbook --role admin
How it works…
The admin role allows a user to perform the following actions on a domain:
- Everything an editor can do such as performing actions related to applications
- Perform operations on a domain such as adding members to a domain
When you run the rhc add-member
command with an admin role, OpenShift will add a new member to a domain with an admin role and then copy the public SSH key to the OpenShift gear ~/.ssh/authorized_keys
file. This allows an editor to perform SSH-related operations.
To check whether the administrator has been added successfully, you can view the domain details by inserting the following command:
$ rhc domain-show Domain prodosbook (owned by openshift.cookbook@gmail.com) ----------------------------------------------------- Created: Jan 14 9:49 AM Allowed Gear Sizes: small Members: openshift.cookbook+test@gmail.com (admin)
There's more…
You can also use the web console to add the editor to your application. Just follow the steps mentioned in the Adding viewer members to a domain using rhc recipe in this chapter.
See also
- The Adding viewer members to a domain using rhc recipe
- The Adding an admin member to a domain using rhc recipe
- The Viewing all the members in a domain using rhc recipe