Add a customizable vagrant environment into a project. This may be used in conjunction with the drupal-skeleton and the-build, or it may be used to retrofit an existing project with our current VM-based development environment.
Note: If you are setting up a new project, you likely want to start with drupal-skeleton.
This Vagrant configuration requires the following plugins:
This setup will use a version of the palantir/drupalbox Vagrant box:
the-vagrant version | palantir/drupalbox version |
---|---|
2.0.1 | 1.1.1, 1.2.0 |
2.0.0 | 1.1.0, 1.1.1 |
0.6.0 - 1.1.1 | >= 0.2.4, < 1.0 |
* Note that version 1.2.0 of the palantir/drupalbox VM requires updating to version 2.0.1 of palantirnet/the-vagrant.
To use the-vagrant on a project, you will need to:
- Require the
palantirnet/the-vagrant
package - Run the-vagrant's install script to add and configure the Vagrantfile
$> composer require palantirnet/the-vagrant
- From within your project, run
vendor/bin/the-vagrant-installer
- This will prompt you for project-specific configuration:
- The project hostname
- The project web root
- Enable Solr
- Enable HTTPS
- Make a project-specific copy of the Ansible roles and a copy of the default playbook
- OR make a project-specific Ansible playbook to be run in addition to the default playbook
- Check in and commit the new Vagrantfile to git
You can re-run the install script later if you need to change your configuration.
Several things can be configured during the interactive installation:
- The project hostname
- The project web root
- Enable Solr
- Enable HTTPS
A few more things can be customized directly in your Vagrantfile
:
- Extra hostnames for this VM (use this for multisite)
- Extra apt packages to install
- The PHP timezone
By default, the-vagrant references ansible roles from the package at vendor/palantirnet/the-vagrant/conf/vagrant/provisioning
. If your project needs configuration beyond what is provided via in the Vagrantfile
, you can re-run the install script and update the provisioning.
- Re-run the install script:
vendor/bin/the-vagrant-installer
- When you are prompted to copy the Ansible roles, reply
n
- When you are prompted to add an additional Ansible playbook to your project, reply
Y
Copy Ansible roles into your project for customization (Y,n) [n]? n
OR add an additional Ansible playbook to your project (Y,n) [n]? Y
- This will create a new
provisioning
directory in your project that contains a simple Ansible playbook and example role. YourVagrantfile
will refer to this playbook in addition to the one in thevendor
directory. - Check in and commit this new
provisioning
directory and updatedVagrantfile
to git - Add or update the roles and playbook as necessary.
- Re-run the install script:
vendor/bin/the-vagrant-installer
- When you are prompted to copy the Ansible roles, reply
Y
:
Copy Ansible roles into your project for customization (Y,n) [n]?
- This will create a new
provisioning
directory in your project that contains the Ansible playbook and roles. YourVagrantfile
will refer to this playbook instead of the one in thevendor
directory. - Check in and commit this new
provisioning
directory and updatedVagrantfile
to git - Add or update the roles and playbook as necessary.
the-vagrant
uses Vagrant boxes built with palantirnet/devkit. You can find more information about the specifics of accessing default software like MySQL, Solr, and Mailhog in the Drupalbox README.
Copyright 2016, 2017, 2018 Palantir.net, Inc.