Set Up Admin Boxes to Control Org-Wide Deployments

The admin box empowers IT operations personnel to easily automate repeatable tasks like setting up dev, test, and staging environments for developers. Admin boxes help developers ensure that applications they deploy using ElasticBox comply with company policies and best practices.

Admin boxes are available in the Enterprise Edition. Only the ElasticBox administrator can set them up and see them. They're not visible to other users in the organization because they seamlessly run in the background when users launch boxes to a particular provider. This lets users or developers focus on what matters most to them: their applications.

As part of their daily routine, IT admins commonly install monitoring agents, ensure the underlying system is configured in a given way, register virtual machines in a database, or simply set up common public keys on all machines before making them available to end users. With ElasticBox, this process can be automated using the admin box. The admin can designate certain boxes to a specific provider to predictably and automatically control every single deployment in that provider's environment.

How Admin Boxes Work
In this article:

Example Uses for the Admin Box

Admin boxes are especially useful in these deployment scenarios:

  • Install a monitoring agent. For every machine that you launch through a particular provider, you can set up an admin box to locally install a monitoring agent like Nagios or New Relic that can monitor and send data back to a central monitoring service.
  • Set the hostname. You can configure the admin box to set the hostname of every virtual machine deployed to a provider’s environment.
  • Register virtual machines on a server. As an example, each time a virtual machine is deployed, you can have an admin box register it to a Chef Master server and then release it when the machine is terminated.
  • Install certificates. You may need to install certificates locally on every virtual machine deployed for production or testing purposes. You can set up an admin box to do this.

How to Set Up an Admin Box for a Provider

An ElasticBox admin can set any box as an admin box for a provider. Each time you deploy a box to that provider, the admin box is executed.

  1. Sign in to ElasticBox as an administrator.
  2. Click Providers and select the provider account to which you want to attach an admin box.
  3. In the provider’s account page, click the gear icon > Admin Boxes.
  4. Click Admin Boxes from the Gear Icon Drop-Down in the Provider Detail Page
  5. In the Admin Box dialog, from the drop-down, select a Windows or Linux based box as the admin box.
  6. Select a Linux or Windows Based Admin Box
    • The drop-down shows all boxes that match the service type (Linux or Windows) in your current workspace. Type a box name in the search box to filter results by that box.
    • If your provider supports both Linux and Windows deployments, you can attach an admin box for each. In this example, since the provider only supports Linux services, we can only select a Linux based box.

    Note: Bindings in an admin box are not executed because the box is designed to execute scripts in an encapsulated fashion from one box. So at deploy time, any bindings in the admin box are omitted.

How Admin Box Scripts Execute

At deploy time, when users launch a box, it’s executed within the admin box just like nested box variables. The admin box treats the box like a box variable. Here’s an example of a box a user launched that includes nested boxes. The install events of the box and the admin box are executed by ElasticBox in the following order:

Order of Executing Scripts When Deploying the Admin Box with Other Boxes

ElasticBox follows the same pattern to execute configure, start, stop, and dispose events for box deployments that involve admin boxes. If you want to execute admin box events before executing other events, move the commands to the admin box install, configure, start, stop, or dispose events.