Currently, only servers can have services associated with them in Aegir's front-end. This is in contrast to Provision, where a service a required in order to write into a context, including platforms and sites. A couple examples might help to illustrate.

In #2412563: amazon s3 storage service, I've begun implementing S3 bucket provisioning for sites. My initial thought was to implement this as a Hosting service, but quickly realized that it didn't make sense to associate it to a server entity. Similarly, for CiviCRM, we provision a CiviCRM database, and provide cron tasks.

In the long run, it might be interesting to even abstract Drupal out of sites, and bundle its functionality in a site-level service.

Comments

ergonlogic’s picture

In fact, as for moving to entities/fields, I think we might want to consider a hosting_service entity as the basis for this re-factoring. Something akin to a simplified field_collection might work. Each service would essentially be a hosting_service bundle with the req'd fields attached. The base hosting_service entity might define 'enabled' and 'required' fields. We might also need a built-in 'type' field to allow a choice between multiple services of the same type.

With something like that, we should be able to also provide some simple wrappers to make adding fields programmatically easier, and allow a 'save_to_context' flag, to then inject the field data into the backend.

Jon Pugh’s picture

I'm taking steps to at least bridge the gap.

I'm adding a way for HostingService classes to inject into Sites and Platforms forms via a method site_form() and platform_form().

Branch coming shortly.

Jon Pugh’s picture

  • Jon Pugh committed 2acb2ed on 2457425-hostingservice-site-form
    Issue #2457425: Allow HostingService classes to easily alter the site...
  • Jon Pugh committed 8a9b87c on 2457425-hostingservice-site-form
    Issue #2457425: Implementing the new HostingService::site_form() method...
Jon Pugh’s picture

The branch and patch do the following:

  1. Alter site node forms (for node edit only.) to add fieldsets for each type of server the site needs: Web and Database.
  2. Injects the form code from HostingService_TYPE_NAME->site_form() into each fieldset.
  3. Implements this change in Hosting SSL by removing the form alter code and moving it to the HostingService class.

These screenshots are the bottom of the Site Node Edit page:

Web tab
Database tab

Jon Pugh’s picture

FileSize
15.54 KB