{# Sets vagrant IP if equals 0.0.0.0 #} {%- if vagrant_ip == '0.0.0.0' -%} {%- set vagrant_ip = ansible_all_ipv4_addresses[1] -%} {%- endif -%} {# Returns the hosts server name based on the document root #} {%- macro getServernameFromDocroot(path) -%} {%- if drupalvm_webserver == 'apache' -%} {%- for host in apache_vhosts -%} {%- if host.documentroot == path -%} {{ host.servername }} {%- endif -%} {%- endfor -%} {%- elif drupalvm_webserver == 'nginx' -%} {%- for host in nginx_vhosts -%} {%- if host.root == path -%} {{ host.server_name }} {%- endif -%} {%- endfor -%} {%- endif -%} {%- endmacro -%} {%- macro printSite(servername, docroot) -%} {%- if docroot not in _devtool_docroots -%} {{ servername }} {{ docroot }} {% if configure_drush_aliases %} drush @{{ vagrant_machine_name }}.{{ servername }} {% endif %} {% endif %} {%- endmacro %} {%- macro printHostsEntry(ip, servername) -%} {%- if servername != ip -%}
  • {{ ip }} {{ servername }}
  • {%- endif -%} {%- endmacro %} {%- macro sectionHost() -%} {%- endmacro -%} {%- macro sectionSiteList() -%}
    {% if configure_drush_aliases -%} {%- endif %} {% if drupalvm_webserver == 'apache' -%} {%- for host in apache_vhosts -%} {%- if host.documentroot is defined -%} {{ printSite(host.servername, host.documentroot) }} {%- endif -%} {%- endfor -%} {%- elif drupalvm_webserver == 'nginx' -%} {%- for host in nginx_vhosts -%} {%- if host.root is defined -%} {%- for hostname in host.server_name.split() -%} {{ printSite(hostname, host.root) }} {%- endfor -%} {%- endif -%} {%- endfor -%} {%- endif %}
    Hostname Document RootDrush alias*
    *Note: If Ansible isn't installed on your host, Drush aliases are only created inside the VM.
    {%- endmacro -%} {%- macro sectionDevelopmentTools() -%}
    {% if not installed_extras -%} {%- endif -%} {% if 'adminer' in installed_extras -%} {% macro servername() %}{{ getServernameFromDocroot(adminer_install_dir) }}/{{ adminer_install_filename }}{% endmacro %} {%- if servername() != "/{{ adminer_install_filename }}" -%} {%- endif -%} {%- endif %} {% if 'mailhog' in installed_extras -%} {% macro servername() %}{{ vagrant_hostname }}:8025{% endmacro %} {%- if servername() != ":8025" -%} {%- endif -%} {%- endif %} {% if 'pimpmylog' in installed_extras -%} {% macro servername() %}{{ getServernameFromDocroot(pimpmylog_install_dir) }}{% endmacro %} {%- if servername() -%} {%- endif -%} {%- endif %} {% if 'solr' in installed_extras -%} {% macro servername() %}{{ vagrant_hostname }}:{{ solr_port }}/solr/{% endmacro %} {%- endif %} {% if 'xhprof' in installed_extras -%} {% macro servername() %}{{ getServernameFromDocroot(php_xhprof_html_dir) }}{% endmacro %} {%- if servername() -%} {%- endif -%} {%- endif %}
    There are no development tools installed inside the VM.
    Adminer {{ servername() }}
    Open Documentation
    MailHog {{ servername() }}
    Open Documentation
    PimpMyLog {{ servername() }}
    Open Documentation
    Solr {{ servername() }}
    Open Documentation
    XHProf {{ servername() }}
    Open Documentation
    {%- endmacro -%} {%- macro sectionPhpInformation() -%}
    PHP Version {{ php_version }}
    Webserver {{ drupalvm_webserver|capitalize }}
    Memory limit {{ php_memory_limit }}
    PHP-FPM enabled {{ 'yes' if php_enable_php_fpm else 'no' }}
    View more details in the server's phpinfo() report.
    {%- endmacro -%} {%- macro sectionDatabaseConnection() -%}
    MySQL Hostname 127.0.0.1
    MySQL Port {{ mysql_port }}
    MySQL Username {{ mysql_root_username }}
    MySQL Password {{ mysql_root_password }}
    SSH Hostname {{ vagrant_ip }}
    SSH Username {{ vagrant_user }}
    SSH Private Key ~/.vagrant.d/insecure_private_key
    {%- endmacro -%} {%- macro sectionDatabaseList() -%}
    {% for database in mysql_databases -%} {% if 'adminer' in installed_extras -%} {% else -%} {%- endif %} {%- endfor %}
    {{ database.name }}
    {{ database.name }}
    {%- endmacro -%} {%- macro SectionDatabaseListLabel() -%} {% if 'adminer' in installed_extras -%} Databases using Adminer {% else -%} Databases {%- endif %} {%- endmacro -%} {%- macro sectionDatabaseUserList() -%}
    {% for user in mysql_users -%} {%- endfor %}
    Username Password
    {{ user.name }} {{ user.password }}
    {%- endmacro -%}
    Drupal VM

    Drupal VM is a VM for local Drupal development, built with Vagrant + Ansible.

    Read the documentation

    Your sites
    {{ sectionSiteList() }}
    {{ SectionDatabaseListLabel() }}
    {{ sectionDatabaseList() }} {{ sectionDatabaseUserList() }}
    PHP information
    {{ sectionPhpInformation() }}
    MySQL connection information
    {{ sectionDatabaseConnection() }}
    Development tools
    {{ sectionDevelopmentTools() }}
    /etc/hosts
    {{ sectionHost() }}
    Unless you're using the vagrant-hostsupdater or vagrant-hostmanager plugin, add the lines above to your host machine's hosts file.