Skip to content

Drupal deployment

Adding a new site

In the inventory there are all Drupal sites defined in a variable called drupal_settings. To add a new site simply add the definition as a new item to that existing array and then run the full farm playbook on the respective host followed by the user playbook:

1
2
apb farm --limit=[HOSTNAME]
apb user --limit=[HOSTNAME] --tags=JailUserInit,SetPermissions

Running the full farm playbook is necessary because a new Drupal site impacts almost all parts of the system.

If you are using jails, then you can limit the Drupal deployment to one of the the jails by adding -e "limit_site=[DRUPAL-SITE-ID]" to the commands above.

If you are also using HaProxy and/or Varnish as well, you may have to run their updates too:

Limiting access with Apache Basic Authentication

If you want to limit access to a Drupal site you can utilize Apache's basic authentication control by simply adding a couple of variables to the drupal_settings in your inventory:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
drupal_settings:
  - id: ...
    root: ...
    domains:
      - domain: www.example.com
        ...
        apache_auth:
          type: Basic
          name: The label for the login dialog
          user: USERNAME
          password: PASSWORD
        ...

To deploy those changes, run

1
ascr role drupal --limit=[HOSTNAME] --tags=ApacheConfig

Update a deployed Drupal site

1
ascr drupal --site=[DRUPAL-SITE-ID]