Variables

The following variables can be set in Vlad's settings file.

Please note that this is not the full list of variables available through Vlad. Though this list is currently the majority of what's available, it is only the variables that Vlad defines itself. Through the use of Ansible Galaxy roles Vlad makes use of other projects that can provide their own additional variables. More info here.

Webserver

webserver_hostname

The hostname of the site you are about to create. By default this is then combined with the variable webserver_hostname_alias to add 'www' to the start.

default value: 'drupal.local'

webserver_hostname_aliases

In order to support multiple projects, or Drupal multi-site installations, this lets you add a list of fully qualified names for your web server aliases.

default value: - 'www.drupal.local'

Vagrantfile configuration

boxipaddress

The IP address of the virtual machine.

default value: "192.168.100.100"

boxname

The name of the box that will be used by Vagrant to label the box inside your virtual machine manager of choice. This value should only contain letters, numbers, hyphens or dots. The VM will appear as boxname + "_vlad" in your chosen virtual machine manager.

default value: "vlad"

vlad_os

The OS that Vlad will use. This can be one of the following:

  • "centos67"
  • "ubuntu12"
  • "ubuntu14"

default value: "ubuntu14"

host_synced_folder

This is the directory that will be used to server the files from. If this doesn't exist then it will be created.

default value: "./docroot"

aux_synced_folder

This is a secondary Vagrant synced folder used to sync files that don't belong in host_synced_folder. If this doesn't exist then it will be created.

default value: "./vlad_aux"

synced_folder_type

Only applicable for when running Vlad on a non-Windows host. Use 'nfs' or 'rsync' for VM file editing in synced folder.

default value: 'nfs'

vlad_synced_folder_mount_options

Set additional mount options for the Vagrant mounts.

default value: [] (i.e. a blank array).

ansible_verbosity

Set the level of verbosity that Ansible will use. This can be one of "", "v", "vv", "vvv", or "vvvv".

default value: ""

vm_cpus

Number of CPU cores to be allocated to the guest VM from the host machine. This can be an integer or can be set to "auto" for Vlad to automatically assign all available cores.

default value: '2'

vm_memory

Amount of memory to be allocated to the guest VM from the host machine. This can be an integer (MB) or can be set to "auto" for Vlad to automatically assign 1/4 of host machine's memory.

default value: '1024'

vlad_parallels_longer_battery_life

Adjusts the "Optimization" > "Power" setting within a Parallels VM's own settings:

  • "off" equates to "Better performance"
  • "on" equates to "Longer battery life"

The value must be surrounded by quotes.

default value: "off"

parallels_update_guest_tools

Whether the vagrant-parallels plugin should update the Guest Tools in the VM automatically.

default value: false

vlad_custom_base_box_name

This sets the custom base box for Vlad to use when utilizing the custom base box functionality. This requires a custom base box to be setup or provided. Please read the documentation on setting up the custom base box if you want to use this feature.

default value: ""

Components to install

The server components that will be installed when the box is provisioned.

  • To install a component set it to true.
  • To leave a component out of the install set the value to false.

aberdeen_cli_install

Installs AberdeenCloud Command Line Tools

default value: false

adminer_install

Installs Adminer.

default value: true

apache_install

Installs Apache server.

default value: true

bling_install

Adds bling.

default value: true

imagemagick_install

Installs Imagemagick as well as the PHP extension.

default value: false

mailcatcher_install

Installs Mailcatcher. Also installs the Ruby task as a dependency.

default value: false

memcached_install

Installs Memcache as well as the PHP extension.

default value: false

munin_install

Installs Munin server.

default value: false

mysql_install

Installs MySQL.

default value: true

node_install

Installs Node.

default value: false

pantheon_cli_install

Installs Pantheon CLI (aka Terminus).

default value: false

platformsh_cli_install

Installs the Platform.sh CLI.

default value: false

php_install

Installs PHP, including a number of PHP packages as well as APC, Composer, and Xdebug.

default value: true

pimpmylog_install

Installs PimpMyLog.

default value: false

redis_install

Installs Redis.

default value: false

ruby_install

Installs Ruby. Ruby is required by MailCatcher.

default value: false

sendmail_install

Installs the Sendmail server.

default value: false

solr_install

Installs Tomcat 6 and Solr 4.

default value: false

varnish_install

Installs Varnish. Vlad will run checks to ensure that varnish can listen on port 80 and that Apache doesn't clash with that port.

default value: false

xhprof_install

Installs Xhprof and a Xhprof GUI.

default value: false

vlad_debug

Print out all available variables to a file called 'ansible.all'.

default value: false

Importing a Pantheon site

Vlad allows you to specify a Pantheon environment and site to import when first setting up the VM. You can import code, database, and file backups. by default, the latter two are imported when you have enabled importing. Set vlad_pantheon_import_include_code to true to import the codebase to Vlad's docroot as well.

To protect your data, these won't be automatically imported more than once. To import again simply rename (or remove) the relevant file from last time: - vlad_aux/pantheon_import.sql.gz # To re-import the DB. - vlad_aux/pantheon_import_files.tar.gz # To re-import files. - docroot # To import or re-import code

When re-importing, back up your previous database first if there's anything you might want to keep. To back up your files, simply move the files directory out of your Drupal site so it won't be overwritten.

This does not guarantee the site will automatically work; you may need to create a local settings file for that and point to the vladdb database.

vlad_pantheon_import

Whether to import a site from Pantheon when provisioning the Vlad VM.

default value: false

vlad_pantheon_import_email

The email you use to log into Pantheon. Needed for Pantheon CLI login.

default value: ''

vlad_pantheon_import_password

The password you use to log into Pantheon. Needed for Pantheon CLI login (sorry, they don't give us any better way to do this yet).

default value: ''

vlad_pantheon_import

The ID of the site (viewable on your dashboard) of the site whose code, files, and DB will be imported when you provision the VM.

default value: ''

vlad_pantheon_import_env

The env to import.

default value: ''

vlad_pantheon_import_include_db

Whether to import the Pantheon Site database (from latest backup).

NOTE: In order for this database to get imported to your Vlad VM, you have to name your first database vladdb and either set db_import_up to true or, if importing several, set the first import file to vlad_aux/db_io/halt_destroy/vladdb.sql.gz.

default value: true

vlad_pantheon_import_include_files

Whether to import the Pantheon Site files (from latest backup).

For this to work, you have to have at least a docroot/sites/default folder.

default value: true

Custom playbook

Vlad provides the following variables to help you integrate a custom playbook as part of provisioning.

Variable Type Default value Description
vlad_custom_play Boolean false Determines whether the custom playbook will run when Vlad provisions the VM.
vlad_custom_play_path String "../vlad_custom/" Relative path to the directory that contains the custom playbook (relative to Vlad's Vagrantfile). Note the closing backslash.
vlad_custom_playfile String "provision.yml" Name of the YAML file to run within the custom playbook (including extension).

See Custom playbook for more information.

HTTP ports

http_port

HTTP port for the web server. If you have opted to install Varnish you will likely want to change this to 8080.

default value: 80

varnish_http_port

HTTP port for the Varnish cache.

default value: 80

Administration email

admin_mail

Used in instances when a server email is needed.

default value: 'test@example.com'

PHP

php_version

The version of PHP to install (dependent on OS). Can be one of:

  • "5.3"
  • "5.4"
  • "5.5"
  • "5.6"

Note that Ubuntu 14 won't install < PHP5.4 so you'll get PHP5.5+. Vlad will error when a version that isn't understood is used.

default value: "5.5"

php.ini

php_memory_limit

default value: 512M

php_max_execution_time

default value: 60

php_post_max_size

default value: 100M

php_upload_max_filesize

default value: 100M

php_display_errors

default value: On

php_display_startup_errors

default value: On

php_html_errors

default value: On

php_date_timezone

default value: Europe/London

Install PECL uploadprogress

php_pecl_uploadprogress

default value: false

PHP APC

apc_rfc1867

default value: '1'

apc_shm_size

default value: '256M'

apc_shm_segments

default value: '1'

apc_num_files_hint

default value: '0'

MySQL

mysql_port

default value: 3306

mysql_root_password

default value: sdfds87643y5thgfd

server_hostname

default value: vlad

dbname

This is a list of databases that Vlad will generate. As a default a single database is created but this value can be changed to make Vlad add more databases. The following setting will generate two databases, one called 'database1' and the other called 'database2'.

dbname: ['database1', 'database2']

Each database has the same access privileges.

It should be noted that the first database in this list is always used as the default database. This database is used by Vlad when running automatic actions such as exporting or importing the database.

default value: ['vladdb']

dbuser

The user that will be created for the databases.

default value: vlad

dbpass

The password for the database user.

default value: wibble

vlad_db_dump_on_halt_destroy

Whether to dump the database on vagrant halt and vagrant destroy.

default value: true

db_import_up

Import MySQL databases from files on 'vagrant up'.

Database import won't occur if the first present database has any tables defined (in order to prevent data loss).

Options include:

  • false - don't import anything
  • true - import from files within vlad_aux/db_io/halt_destroy/ - source filenames will need to correspond with values in dbname.
  • ["path_to_file","path_to_file"] - import from vlad_aux/db_io/[path_to_file]. Requires an entry for each database specified in dbname. Supports .sql, .bz2 and .gz files.

default value: false

MySQL my.cnf

mysql_max_allowed_packet

default value: 128M

innodb_buffer_pool_size

default value: 64M

innodb_file_per_table

default value: true

innodb_log_file_size

default value: 64M

mysql_character_set_server

default value: utf8

mysql_collation_server

default value: utf8_general_ci

skip_name_resolve

default value: true

mysql_hosts

A list of hosts that MySQL should map to databases to allow access.

default value: ['{{ local_ipv4_address.ansible_facts.ansible_default_ipv4.address }}', '127.0.0.1', 'localhost']

mysql_allow_all_hosts

Whether to allow all hosts (0.0.0.0) or a specific IP address (which is taken from the boxipaddress variable) default value: true

mysql_slow_query_log_status

This sets the MySQL slow query log status. Turn on with 1, turn off with 0.

default value : 0

mysql_slow_query_log_location

This sets the location of the MySQL slow query log.

default value : '/var/log/mysql/mysql-slow.log'

mysqL_long_query_time

The amount of time that a query must last before being logged into the slow query log.

default value: 2

mysql_log_queries_not_using_indexes

Whether MySQL should also log any query that doesn't use indexes.

default value: false

SSH

ssh_port

default value: 22

use_host_id

Add RSA or DSA identity from host to guest on 'vagrant up'. Does not support identities that require a passphrase.

Options include:

  • false : don't add anything
  • true : add default files (~/.ssh/id_rsa, ~/.ssh/id_dsa & ~/.ssh/identity)
  • "[filename]" : add a specific file e.g. /Users/username/.ssh/[filename]

NOTE: In order for this to work correctly you also need to setup agent forwarding on your host machine. This is done by including the following into your ~/.ssh/config file. This assumes that you are keeping the default '.local' domains that come with Vlad.

Host *.local
    ForwardAgent yes

default value: false

Varnish

varnish_memory

Sets the amount of memory that Varnish can use (in Megabytes).

default value: 512

Redis

redis_port

Sets the port Redis should listen on.

default value: 6379

Drush

drush_install_path: /usr/local/share/drush

The location of the entire drush installation (includes all the supporting files, as well as the drush executable file.

drush_path: /usr/local/bin/drush

The path where drush will be installed and available to your system. Should be in your user's $PATH so you can run commands simply with drush instead of the full path.

drush_version: 8.0.1

The version of Drush to install (examples: "master" for the bleeding edge, "7.x", "6.x", "6.2.0"). This should be a string as it refers to a git branch, tag, or commit hash.

drush_prefer_packaged_download: true

If set to true, the role will attempt to install Drush from a downloaded .phar file. Note that .phar files are only available through later releases of Drush and will require drush_version to be set to 8.0.0-rc3 or higher.

The following variables only apply to installation via Composer

drush_composer_path: /usr/local/bin/composer

Path to where Composer is installed.

drush_keep_updated: no

Whether to keep Drush up-to-date with the latest revision of the branch specified by drush_version.

Drush extras

Additional Drush commands

drush_install_commands

Additional Drush commands to be installed.

Default value:

drush_install_commands:
  - { name: 'coder', version: '-7.x-2.x'}
  - { name: 'site_audit', version: ''}
  - { name: 'registry_rebuild', version: ''}

Drush make

drush_make_file

The name of a Drush make file that is to be run. Vlad expects this file to be placed in a subdirectory called "make" within your vlad_aux directory.

E.g. "vlad_example_d7.make"

Drush make will not be run if no file is specified.

default value: ""

drush_make_options

Options to pass to the drush make command when a file has been specified with drush_make_file.

E.g. "--prepare-install"

See http://www.drushcommands.com/drush-6x/make/make for possible options.

default value: ""

drush_make_force

Run drush make every time the VM is provisioned. Setting to false will only run drush make if a make file has been specified and docroot does not contain an existing Drupal codebase.

default value: false

drushrc.php

drush_structure_tables

Sets the tables to be skipped in the "$options['structure-tables']['common']" config variable in the .drushrc.php file. Allows you to run drush database dump commands using the --structure-tables-key parameter to skip certain table data like caches and session data. For example, to export the database and skip those tables you would run the following command.

drush sql-dump --structure-tables-key=common --gzip --result-file=dump.sql

default value: "['cache','cache_filter','cache_menu','cache_page','history','sessions','watchdog','cache_admin_menu','cache_block','cache_field','cache_form','cache_path','cache_token','cache_update','cache_views','cache_views_data','ctools_css_cache','ctools_object_cache','search_dataset','search_index','search_node_links','search_total']"

Drupal

vlad_drupal_install

Install a fresh copy of Drupal when provisioning.

NOTE: Setting this to true will remove EVERYTHING inside docroot when run.

Default value: false

vlad_drupal_install_version

Which version of Drupal to install. Available options:

  • 6
  • 7
  • 8
  • 8dev (will include the relevant Git repo)

8 & 8dev require Drush 8.

Default value: 7

Bling

bling_shell_prompt

Tweaks shell prompt.

default value: true

Other settings

drupal_solr_package

Select which Solr module to install accepted values are 'search_api_solr' or 'apachesolr'

default value: "search_api_solr"

hosts_file_location

Local hosts file location.

Default location on *nix hosts is '/etc/hosts'.

Default location for GasMask on OSX is '/Users/< username >/Library/Gas Mask/Local/< file >.hst'.

default value: "/etc/hosts"

hosts_file_update

Select whether Vlad should edit the hosts file.

default value: true

add_index_file

Add the default index.php file (useful to turn off if you are going git clone into the web root folder). Vlad will also not overwrite any existing index.php file present in the docroot location.

default value: true

vlad_private_files_dir

Create a directory within vlad_aux for Drupal to use for private files storage.

Note that this option simply ensures that the directory is present, it does not attempt to configure your Drupal site.

Accepted values:

  • false: no directory created
  • true: creates vlad_aux/private
  • string: creates vlad_aux/string

Default value: false

vlad_extra_packages

A list that allows users to install extra packages along with the current box. This is merged at runtime with vlad_yum_packages for Centos systems and vlad_apt_packages for Ubuntu systems.

Default value: - curl

Git config user credentials

Leave these variables empty to skip this step.

git_user_name

Your git username.

default value: ""

git_user_email

Your git email address.

default value: ""