From df18284ef604ebfb0a6ee73ba18144badce25206 Mon Sep 17 00:00:00 2001 From: "Shawn S. Smiley" Date: Tue, 7 Jul 2015 20:12:17 -0700 Subject: [PATCH 0001/1273] Added support for the vagrant-auto_network plugin. --- README.md | 3 +++ Vagrantfile | 6 +++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 3a31be2c7..e6a29daa9 100644 --- a/README.md +++ b/README.md @@ -74,6 +74,9 @@ Note: *If there are any errors during the course of running `vagrant up`, and it ### 3 - Configure your host machine to access the VM. 1. [Edit your hosts file](http://www.rackspace.com/knowledge_center/article/how-do-i-modify-my-hosts-file), adding the line `192.168.88.88 drupalvm.dev` so you can connect to the VM. Alternatively, you can install a Vagrant plugin to automatically add and remove the entry from your hosts file; run `vagrant plugin install vagrant-hostsupdater`. The plugin will also add in all other hosts defined via `apache_vhosts`. + - You can have vagrant automatically assign IP addresses to your VM by adding the vagrant-auto_network plugin (`vagrant plugin install vagrant-auto_network`). + - To use the vagrant-auto_network plugin, set the vagrant_ip setting in your config.yml file to "0.0.0.0" + NOTE: You will want to use the vagrant-hostsupdater plugin in combination with vagrant-auto_network. 2. Open your browser and access [http://drupalvm.dev/](http://drupalvm.dev/). The default login for the admin account is `admin` for both the username and password. ## Extra software/utilities diff --git a/Vagrantfile b/Vagrantfile index 8ca381289..5e3af5283 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -16,7 +16,11 @@ is_windows = (RbConfig::CONFIG['host_os'] =~ /mswin|mingw|cygwin/) Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| config.vm.hostname = vconfig['vagrant_hostname'] - config.vm.network :private_network, ip: vconfig['vagrant_ip'] + if vconfig['vagrant_ip'] == "0.0.0.0" && Vagrant.has_plugin?("vagrant-auto_network") + config.vm.network :private_network, :ip => "0.0.0.0", :auto_network => true + else + config.vm.network :private_network, ip: vconfig['vagrant_ip'] + end config.ssh.insert_key = false config.ssh.forward_agent = true From 5acd5e57dd095319130bc2459bf4c4adef47bce9 Mon Sep 17 00:00:00 2001 From: Sidney Gijzen Date: Wed, 29 Jul 2015 14:16:47 +0200 Subject: [PATCH 0002/1273] Updated documentation links To point to http://docs.drupalvm.com instead of the Github wiki --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index a65c8c1fc..0fd94ebb4 100644 --- a/README.md +++ b/README.md @@ -27,7 +27,7 @@ It will install the following on an Ubuntu 14.04 (by default) linux VM: It should take 5-10 minutes to build or rebuild the VM from scratch on a decent broadband connection. -Please read through the rest of this README and the [Drupal VM Wiki](https://github.com/geerlingguy/drupal-vm/wiki) for help getting Drupal VM configured and integrated with your development workflow. +Please read through the rest of this README and the [Drupal VM documentation](http://docs.drupalvm.com/) for help getting Drupal VM configured and integrated with your development workflow. ## Documentation @@ -47,7 +47,7 @@ If you want to switch from Drupal 8 (default) to Drupal 7 or 6 on the initial in ## Quick Start Guide -This Quick Start Guide will help you quickly build a Drupal 8 site on the Drupal VM using the included example Drush make file. You can also use the Drupal VM with a [Local Drupal codebase](https://github.com/geerlingguy/drupal-vm/wiki/Local-Drupal-codebase) or even a [Drupal multisite installation](https://github.com/geerlingguy/drupal-vm/wiki/Drupal-multisite). +This Quick Start Guide will help you quickly build a Drupal 8 site on the Drupal VM using the included example Drush make file. You can also use the Drupal VM with a [Local Drupal codebase](http://docs.drupalvm.com/en/latest/deployment/local-codebase/) or even a [Drupal multisite installation](http://docs.drupalvm.com/en/latest/deployment/multisite/). ### 1 - Install dependencies (VirtualBox, Vagrant, Ansible) @@ -98,7 +98,7 @@ If you don't want or need one or more of these extras, just delete them or comme ## Using Drupal VM -Drupal VM is built to integrate with every developer's workflow. Many guides for using Drupal VM for common development tasks are available on the [Drupal VM Wiki](https://github.com/geerlingguy/drupal-vm/wiki): +Drupal VM is built to integrate with every developer's workflow. Many guides for using Drupal VM for common development tasks are available on the [Drupal VM documentation site](http://docs.drupalvm.com): - [Syncing Folders](http://docs.drupalvm.com/en/latest/extras/syncing-folders/) - [Connect to the MySQL Database](http://docs.drupalvm.com/en/latest/extras/mysql/) From ac4584593dda7f81141aa127904f087ab9dc5241 Mon Sep 17 00:00:00 2001 From: Sidney Gijzen Date: Wed, 29 Jul 2015 14:18:45 +0200 Subject: [PATCH 0003/1273] Updated documentation link To point to http://docs.drupalvm.com instead of the Github wiki. --- example.config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/example.config.yml b/example.config.yml index 50d0fc0c4..589e89840 100644 --- a/example.config.yml +++ b/example.config.yml @@ -12,7 +12,7 @@ vagrant_ip: 192.168.88.88 # A list of synced folders, with the keys 'local_path', 'destination', 'id', and # a 'type' of [nfs|rsync|smb] (leave empty for slow native shares). See -# https://github.com/geerlingguy/drupal-vm/wiki/Syncing-Folders for more info. +# http://docs.drupalvm.com/en/latest/extras/syncing-folders/ for more info. vagrant_synced_folders: # The first synced folder will be used for the default Drupal installation, if # build_from_makefile is 'true'. From 57434b0a901beefa49556884008df4c9872a7d41 Mon Sep 17 00:00:00 2001 From: Jeff Geerling Date: Wed, 29 Jul 2015 08:12:37 -0500 Subject: [PATCH 0004/1273] PR #155: Adjust documentation slightly for auto_network plugin. --- README.md | 7 +++---- Vagrantfile | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 7efa6c890..97206b15a 100644 --- a/README.md +++ b/README.md @@ -76,10 +76,9 @@ Note: *If there are any errors during the course of running `vagrant up`, and it ### 3 - Configure your host machine to access the VM. - 1. [Edit your hosts file](http://www.rackspace.com/knowledge_center/article/how-do-i-modify-my-hosts-file), adding the line `192.168.88.88 drupalvm.dev` so you can connect to the VM. Alternatively, you can install a Vagrant plugin to automatically add and remove the entry from your hosts file; run `vagrant plugin install vagrant-hostsupdater`. The plugin will also add in all other hosts defined via `apache_vhosts`. - - You can have vagrant automatically assign IP addresses to your VM by adding the vagrant-auto_network plugin (`vagrant plugin install vagrant-auto_network`). - - To use the vagrant-auto_network plugin, set the vagrant_ip setting in your config.yml file to "0.0.0.0" - NOTE: You will want to use the vagrant-hostsupdater plugin in combination with vagrant-auto_network. + 1. [Edit your hosts file](http://www.rackspace.com/knowledge_center/article/how-do-i-modify-my-hosts-file), adding the line `192.168.88.88 drupalvm.dev` so you can connect to the VM. + - You can have Vagrant automatically configure your hosts file if you install the `hostsupdater` plugin (`vagrant plugin install vagrant-hostsupdater`). All hosts defined in `apache_vhosts` will be automatically managed. + - You can also have Vagrant automatically assign an available IP address to your VM if you install the `auto_network` plugin (`vagrant plugin install vagrant-auto_network`), and set `vagrant_ip` to `0.0.0.0` inside `config.yml`. 2. Open your browser and access [http://drupalvm.dev/](http://drupalvm.dev/). The default login for the admin account is `admin` for both the username and password. ## Extra software/utilities diff --git a/Vagrantfile b/Vagrantfile index dba872c11..ab9a4e776 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -17,7 +17,7 @@ is_windows = (RbConfig::CONFIG['host_os'] =~ /mswin|mingw|cygwin/) Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| config.vm.hostname = vconfig['vagrant_hostname'] if vconfig['vagrant_ip'] == "0.0.0.0" && Vagrant.has_plugin?("vagrant-auto_network") - config.vm.network :private_network, :ip => "0.0.0.0", :auto_network => true + config.vm.network :private_network, :ip => vconfig['vagrant_ip'], :auto_network => true else config.vm.network :private_network, ip: vconfig['vagrant_ip'] end From fd73a1ece2996f9092d82b100233c991e66c9636 Mon Sep 17 00:00:00 2001 From: Jeff Geerling Date: Wed, 29 Jul 2015 08:21:49 -0500 Subject: [PATCH 0005/1273] PR #155: Add 'Networking Notes' section to docs. --- docs/other/networking.md | 12 ++++++++++++ mkdocs.yml | 1 + 2 files changed, 13 insertions(+) create mode 100644 docs/other/networking.md diff --git a/docs/other/networking.md b/docs/other/networking.md new file mode 100644 index 000000000..3604e3723 --- /dev/null +++ b/docs/other/networking.md @@ -0,0 +1,12 @@ +Since Vagrant manages internal network connections for Drupal VM, and since every person's network setup is unique, there are sometimes networking issues that require some adjustments to your Drupal VM configuration or a computer reboot. + +## Network Route Collision + +Drupal VM comes configured with the default IP address `192.168.88.88`. If you're connected to a LAN with the same private IP address range (e.g. `192.168.x.x`), then VirtualBox or VMware will not be able to set up the VM with the default IP address, because that would conflict with the `192.168.x.x` network your computer is using. + +In this case, you have two options: + + 1. Switch the `vagrant_ip` in `config.yml` to a different private IP address, e.g. `172.16.0.88` or `10.0.1.88`. + 2. Install the `vagrant-auto_network` plugin (`vagrant plugin install vagrant-auto_network`), and set the `vagrant_ip` to `0.0.0.0`. + +Another cause of route collisions is the use of multiple VM providers on your computer. If you have both VirtualBox and VMware Fusion, and you have VMs running in both, and you attempt to use the same IP range in both providers, you'll hit a networking conflict. In this case, the only easy way to restore connectivity is to restart your host machine. diff --git a/mkdocs.yml b/mkdocs.yml index 028095faa..f8721d58a 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -30,6 +30,7 @@ pages: - Other Information: - 'Using Different Base OSes': 'other/base-os.md' - 'PHP 7 on Drupal VM': 'other/php-7.md' + - 'Networking Notes': 'other/networking.md' - 'Drupal 6 Notes': 'other/drupal-6.md' - 'Windows Notes': 'other/windows.md' - 'Cloning Drupal VM with newd': 'other/cloning-with-newd.md' From 94dc0f8dc51cc0b25b5d9d67118c95bbe8cdacad Mon Sep 17 00:00:00 2001 From: Christopher Panza Date: Mon, 3 Aug 2015 00:10:51 -0400 Subject: [PATCH 0006/1273] Update documentation for xhprof and pimpmylog urls --- docs/extras/pimpmylog.md | 4 ++-- docs/extras/xhprof.md | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/extras/pimpmylog.md b/docs/extras/pimpmylog.md index 1abed918a..c7634eb67 100644 --- a/docs/extras/pimpmylog.md +++ b/docs/extras/pimpmylog.md @@ -1,8 +1,8 @@ -[Pimp my Log](http://pimpmylog.com/) is a PHP-based web GUI for viewing log files on a given server. By default, it is installed on Drupal VM, and you can access it at the URL `http://local.pimpmylog.com/` (as long as you have a hosts entry for that URL pointing at Drupal VM's IP address!). +[Pimp my Log](http://pimpmylog.com/) is a PHP-based web GUI for viewing log files on a given server. By default, it is installed on Drupal VM, and you can access it at the URL `http://pimpmylog.drupalvm.dev/` (as long as you have a hosts entry for that URL pointing at Drupal VM's IP address!). By default, it will find the default Apache 2 `access.log` and `error.log` files, but it will not find other logs, like MySQL or extra Apache virtualhost logs. -When configuring Pimp my Log (on the first visit to the `local.pimpmylog.com` URL), you can add extra paths in the UI, or you can add them after the fact by manually editing the configuration file, which by default is stored at `/usr/share/php/pimpmylog/config.user.php`. You can also delete that file and re-configure Pimp my Log via the web UI. +When configuring Pimp my Log (on the first visit to the `pimpmylog.drupalvm.dev` URL), you can add extra paths in the UI, or you can add them after the fact by manually editing the configuration file, which by default is stored at `/usr/share/php/pimpmylog/config.user.php`. You can also delete that file and re-configure Pimp my Log via the web UI. Some log files you may be interested in monitoring: diff --git a/docs/extras/xhprof.md b/docs/extras/xhprof.md index 1609e1047..19b43a882 100644 --- a/docs/extras/xhprof.md +++ b/docs/extras/xhprof.md @@ -11,4 +11,4 @@ The XHProf module doesn't yet include support for callgraphs, but there's an iss The Devel module also *used* to provide XHProf configuration, and setting the options below would allow Devel's XHProf integration to work correctly with Drupal VM's XHProf installation: - **xhprof directory**: `/usr/share/php` - - **XHProf URL**: `http://local.xhprof.com/` (assuming this domain is configured in `apache_vhosts` inside `config.yml`) \ No newline at end of file + - **XHProf URL**: `http://xhprof.drupalvm.dev/` (assuming this domain is configured in `apache_vhosts` inside `config.yml`) From f910a4e66a590dd5870b0b8c2e546f17536480e2 Mon Sep 17 00:00:00 2001 From: Moshe Weitzman Date: Mon, 3 Aug 2015 13:51:26 -0400 Subject: [PATCH 0007/1273] Avoid Drupal installer exception for xdebug nesting level ``` Exception 'Drupal\Core\Installer\Exception\InstallerException' with message 'Xdebug settings: xdebug.max_nesting_level is set to 255. Set xdebug.max_nesting_level=256 in your PHP configuration as some pages in your Drupal site will not work when this setting is too low.' in /var/www/drupal/core/includes/install.core.inc:2292 ``` --- example.config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/example.config.yml b/example.config.yml index 589e89840..beb1b01b2 100644 --- a/example.config.yml +++ b/example.config.yml @@ -163,7 +163,7 @@ php_xdebug_remote_enable: 1 php_xdebug_remote_connect_back: 1 # Use PHPSTORM for PHPStorm, sublime.xdebug for Sublime Text. php_xdebug_idekey: PHPSTORM -php_xdebug_max_nesting_level: 255 +php_xdebug_max_nesting_level: 256 # Solr Configuration (if enabled above). solr_version: "4.10.4" From 34583aee835f14096a10fd915f2b3e2ed7764eaf Mon Sep 17 00:00:00 2001 From: Sidney Gijzen Date: Tue, 4 Aug 2015 17:35:19 +0200 Subject: [PATCH 0008/1273] Fix formatting and add note about permission settings on some log files. --- docs/extras/pimpmylog.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/extras/pimpmylog.md b/docs/extras/pimpmylog.md index c7634eb67..46b0b69bc 100644 --- a/docs/extras/pimpmylog.md +++ b/docs/extras/pimpmylog.md @@ -10,7 +10,9 @@ Some log files you may be interested in monitoring: - `/var/log/apache2/error.log` (this log will show Apache and PHP notices/warnings/errors) - `/var/log/apache2/other_vhosts_access.log` - `/var/log/mysql.err` (MySQL error log) - - `/var/log/mysql-slow.log (MySQL slow query log) + - `/var/log/mysql-slow.log` (MySQL slow query log) - `/var/log/syslog` (enable the Drupal syslog module to route watchdog log entries to this file) -For MySQL logs, you might want to read through the PML docs on [MySQL](http://support.pimpmylog.com/kb/softwares/mysql). \ No newline at end of file +For MySQL logs, you might want to read through the PML docs on [MySQL](http://support.pimpmylog.com/kb/softwares/mysql). + +It might be necessary to grant read permissions to the other group (e.g. `chmod o+r /var/log/mysql.err`) on some log files in order for Pimp My Log to be able to parse them. From 030e492f6cff75441aebc5bbbcd4fe52c93eaff5 Mon Sep 17 00:00:00 2001 From: cthos Date: Thu, 6 Aug 2015 10:01:09 -0700 Subject: [PATCH 0009/1273] Set example mysql_wait_timeout to 300. --- example.config.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/example.config.yml b/example.config.yml index beb1b01b2..6bb543d57 100644 --- a/example.config.yml +++ b/example.config.yml @@ -143,6 +143,7 @@ composer_home_path: '/home/vagrant/.composer' mysql_root_password: root mysql_slow_query_log_enabled: true mysql_slow_query_time: 2 +mysql_wait_timeout: 300 adminer_add_apache_config: true # Varnish Configuration. From 5e0a2deeab7ae7e6366b4eafd204a9cb911e46fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oskar=20Sch=C3=B6ldstr=C3=B6m?= Date: Fri, 7 Aug 2015 23:42:21 -0500 Subject: [PATCH 0010/1273] Issue #186: Do not accept locale environment variables passed over SSH --- provisioning/playbook.yml | 1 + provisioning/tasks/sshd.yml | 7 +++++++ 2 files changed, 8 insertions(+) create mode 100644 provisioning/tasks/sshd.yml diff --git a/provisioning/playbook.yml b/provisioning/playbook.yml index 3b07db67b..428174116 100644 --- a/provisioning/playbook.yml +++ b/provisioning/playbook.yml @@ -46,6 +46,7 @@ stat: "path={{ drupal_core_path }}/index.php" register: drupal_site + - include: tasks/sshd.yml - include: tasks/extras.yml - include: tasks/www.yml - include: tasks/apparmor.yml diff --git a/provisioning/tasks/sshd.yml b/provisioning/tasks/sshd.yml new file mode 100644 index 000000000..262430b0c --- /dev/null +++ b/provisioning/tasks/sshd.yml @@ -0,0 +1,7 @@ +--- +- name: Do not accept locale environment variables passed over SSH. + lineinfile: + dest: /etc/ssh/sshd_config + regexp: "^AcceptEnv LANG" + state: absent + validate: "/usr/sbin/sshd -T -f %s" From 3d974aac7ce662484beec8cfe78f4d5b12b84417 Mon Sep 17 00:00:00 2001 From: Sidney Gijzen Date: Wed, 12 Aug 2015 21:38:19 +0200 Subject: [PATCH 0011/1273] Add a bit more explanation to the extra_packages variable --- example.config.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/example.config.yml b/example.config.yml index 6bb543d57..9d155b5cc 100644 --- a/example.config.yml +++ b/example.config.yml @@ -100,7 +100,9 @@ installed_extras: - xdebug - xhprof -# Add any extra packages you'd like to install. +# Add any extra apt or yum packages. Use the apt or yum package name to +# indicate which package you'd like to install. E.g. the unzip apt package is +# used by Drush to unzip libraries downloaded by Drush make files. extra_packages: [] # You can configure almost anything else on the server in the rest of this file. From 230d97557794def17d789e27c305f0c43cd49dd1 Mon Sep 17 00:00:00 2001 From: Jeff Geerling Date: Fri, 14 Aug 2015 18:39:56 -0500 Subject: [PATCH 0012/1273] Fixes #200: Java role is always installed, regardless of installed_extras. --- provisioning/playbook.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/provisioning/playbook.yml b/provisioning/playbook.yml index 3b07db67b..c4759af7f 100644 --- a/provisioning/playbook.yml +++ b/provisioning/playbook.yml @@ -33,7 +33,7 @@ - { role: geerlingguy.pimpmylog, when: '"pimpmylog" in installed_extras' } - { role: geerlingguy.daemonize, when: '"mailhog" in installed_extras' } - { role: geerlingguy.mailhog, when: '"mailhog" in installed_extras' } - - { role: geerlingguy.java, when: '"solr" or "selenium" in installed_extras' } + - { role: geerlingguy.java, when: '"solr" in installed_extras or "selenium" in installed_extras' } - { role: arknoll.selenium, when: '"selenium" in installed_extras' } - { role: geerlingguy.solr, when: '"solr" in installed_extras' } - { role: geerlingguy.varnish, when: '"varnish" in installed_extras' } From 42877d1e6b106c790b13b6f859b9bc19c300b63a Mon Sep 17 00:00:00 2001 From: Andrei Simion Date: Tue, 18 Aug 2015 11:38:50 +0100 Subject: [PATCH 0013/1273] Pass the port number from the Vagrant autogenerated inventory --- provisioning/templates/drupalvm.aliases.drushrc.php.j2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/provisioning/templates/drupalvm.aliases.drushrc.php.j2 b/provisioning/templates/drupalvm.aliases.drushrc.php.j2 index 9f1138518..eab5d77af 100644 --- a/provisioning/templates/drupalvm.aliases.drushrc.php.j2 +++ b/provisioning/templates/drupalvm.aliases.drushrc.php.j2 @@ -12,7 +12,7 @@ $aliases['{{ vhost.servername }}'] = array( 'root' => '{{ vhost.documentroot }}', 'remote-host' => '{{ vhost.servername }}', 'remote-user' => 'vagrant', - 'ssh-options' => '-o PasswordAuthentication=no -i ~/.vagrant.d/insecure_private_key', + 'ssh-options' => '-p {{ ansible_ssh_port }} -o PasswordAuthentication=no -i ~/.vagrant.d/insecure_private_key', ); {% endfor %} From 83320b2943a57f3668e9b9029eaf48c4121f73ca Mon Sep 17 00:00:00 2001 From: Jeff Geerling Date: Tue, 18 Aug 2015 14:07:30 -0700 Subject: [PATCH 0014/1273] PR #195: Better language for extra_packages variable. --- example.config.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/example.config.yml b/example.config.yml index 9d155b5cc..764230333 100644 --- a/example.config.yml +++ b/example.config.yml @@ -100,10 +100,9 @@ installed_extras: - xdebug - xhprof -# Add any extra apt or yum packages. Use the apt or yum package name to -# indicate which package you'd like to install. E.g. the unzip apt package is -# used by Drush to unzip libraries downloaded by Drush make files. -extra_packages: [] +# Add any extra apt or yum packages you would like installed. +extra_packages: + - unzip # You can configure almost anything else on the server in the rest of this file. extra_security_enabled: false From 72ba56bbe93e46f7e848eff0af54513aa850b8f7 Mon Sep 17 00:00:00 2001 From: Jeff Geerling Date: Tue, 18 Aug 2015 14:55:38 -0700 Subject: [PATCH 0015/1273] Update JJG-Ansible-Windows dependency. --- provisioning/JJG-Ansible-Windows/windows.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/provisioning/JJG-Ansible-Windows/windows.sh b/provisioning/JJG-Ansible-Windows/windows.sh index 9ef898bae..f6d045eef 100644 --- a/provisioning/JJG-Ansible-Windows/windows.sh +++ b/provisioning/JJG-Ansible-Windows/windows.sh @@ -50,7 +50,7 @@ fi # Install requirements. echo "Installing Ansible roles from requirements file, if available." -find "/vagrant/$PLAYBOOK_DIR" \( -name "requirements.yml" -o -name "requirements.txt" \) -exec sudo ansible-galaxy install -r {} \; +find "/vagrant/$PLAYBOOK_DIR" \( -name "requirements.yml" -o -name "requirements.txt" \) -exec sudo ansible-galaxy install --ignore-errors -r {} \; # Run the playbook. echo "Running Ansible provisioner defined in Vagrantfile." From c3baf7e0695feaa0b9d9635832d341a786f8ab30 Mon Sep 17 00:00:00 2001 From: Jeff Geerling Date: Tue, 18 Aug 2015 16:16:39 -0700 Subject: [PATCH 0016/1273] Issue #199: Use Ansible inside VM if Ansible is not present on the host. --- Vagrantfile | 32 ++++++++++++++++++++------------ 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/Vagrantfile b/Vagrantfile index ab9a4e776..7aa27bf97 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -2,6 +2,18 @@ # vi: set ft=ruby : VAGRANTFILE_API_VERSION = "2" +# Cross-platform way of finding an executable in the $PATH. +def which(cmd) + exts = ENV['PATHEXT'] ? ENV['PATHEXT'].split(';') : [''] + ENV['PATH'].split(File::PATH_SEPARATOR).each do |path| + exts.each { |ext| + exe = File.join(path, "#{cmd}#{ext}") + return exe if File.executable?(exe) && !File.directory?(exe) + } + end + return nil +end + # Use config.yml for basic VM configuration. require 'yaml' dir = File.dirname(File.expand_path(__FILE__)) @@ -10,10 +22,6 @@ if !File.exist?("#{dir}/config.yml") end vconfig = YAML::load_file("#{dir}/config.yml") -# Use rbconfig to determine if we're on a windows host or not. -require 'rbconfig' -is_windows = (RbConfig::CONFIG['host_os'] =~ /mswin|mingw|cygwin/) - Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| config.vm.hostname = vconfig['vagrant_hostname'] if vconfig['vagrant_ip'] == "0.0.0.0" && Vagrant.has_plugin?("vagrant-auto_network") @@ -48,18 +56,18 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| mount_options: synced_folder.include?('mount_options') ? synced_folder['mount_options'] : [] end - if is_windows - # Provisioning configuration for shell script (for Windows). - config.vm.provision "shell" do |sh| - sh.path = "#{dir}/provisioning/JJG-Ansible-Windows/windows.sh" - sh.args = "/provisioning/playbook.yml" - end - else - # Provisioning configuration for Ansible (for Mac/Linux hosts). + # Provision using Ansible provisioner if Ansible is installed on host. + if which('ansible-playbook') config.vm.provision "ansible" do |ansible| ansible.playbook = "#{dir}/provisioning/playbook.yml" ansible.sudo = true end + # Provision using shell provisioner and JJG-Ansible-Windows otherwise. + else + config.vm.provision "shell" do |sh| + sh.path = "#{dir}/provisioning/JJG-Ansible-Windows/windows.sh" + sh.args = "/provisioning/playbook.yml" + end end # VMware Fusion. From 4e00d8fc09695581094fac2ab93ddfbeb8072dac Mon Sep 17 00:00:00 2001 From: Jeff Geerling Date: Wed, 19 Aug 2015 17:15:58 -0700 Subject: [PATCH 0017/1273] Better spacing for code example. --- docs/other/php-7.md | 39 ++++++++++++++++++++------------------- 1 file changed, 20 insertions(+), 19 deletions(-) diff --git a/docs/other/php-7.md b/docs/other/php-7.md index 620aff684..fe717a4b4 100644 --- a/docs/other/php-7.md +++ b/docs/other/php-7.md @@ -30,25 +30,26 @@ However, there's currently a bug with the beta1 version of the package, which ca After configuring Drupal VM to [use a different base OS](https://github.com/geerlingguy/drupal-vm/wiki/Using-Different-Base-OSes) (in this case, CentOS 7), you need to do the following to get PHP 7 running inside the VM: 1. Make the following changes to `config.yml`: - ```yaml - # Changes to make PHP 7 work in CentOS via Remi's repo. - php_executable: php70 - php_packages: - - ImageMagick - - php70 - - php70-php - - php70-fakepear - - php70-php-devel - - php70-php-gd - - php70-php-imap - - php70-php-ldap - - php70-php-mbstring - - php70-php-pdo - - php70-php-process - - php70-php-xml - - php70-php-xmlrpc - php_mysql_package: php70-php-mysqlnd - ``` + + ```yaml + # Changes to make PHP 7 work in CentOS via Remi's repo. + php_executable: php70 + php_packages: + - ImageMagick + - php70 + - php70-php + - php70-fakepear + - php70-php-devel + - php70-php-gd + - php70-php-imap + - php70-php-ldap + - php70-php-mbstring + - php70-php-pdo + - php70-php-process + - php70-php-xml + - php70-php-xmlrpc + php_mysql_package: php70-php-mysqlnd + ``` 2. At this time, automatic install of `xhprof` and `xdebug` are unsupported. Make sure these options are commented or removed from the `installed_extras` setting in `config.yml`. From cf8ae4fe2720f153ec7022d339a6108740c2587b Mon Sep 17 00:00:00 2001 From: Jeff Geerling Date: Wed, 19 Aug 2015 17:20:20 -0700 Subject: [PATCH 0018/1273] Fixes #199: Use Ansible inside VM if Ansible is not present on the host - docs. --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 97206b15a..58adfb94b 100644 --- a/README.md +++ b/README.md @@ -53,13 +53,12 @@ This Quick Start Guide will help you quickly build a Drupal 8 site on the Drupal 1. Download and install [VirtualBox](https://www.virtualbox.org/wiki/Downloads) (Drupal VM also works with Parallels or VMware, if you have the [Vagrant VMware integration plugin](http://www.vagrantup.com/vmware)). 2. Download and install [Vagrant](http://www.vagrantup.com/downloads.html). - 3. [Mac/Linux only] Install [Ansible](http://docs.ansible.com/intro_installation.html). -Note for Windows users: *Ansible will be installed inside the VM, and everything will be configured internally (unlike on Mac/Linux hosts). See [JJG-Ansible-Windows](https://github.com/geerlingguy/JJG-Ansible-Windows) for more information.* +Note for Faster Provisioning (Mac/Linux only): *For faster and more efficient provisioning, you should [install Ansible](http://docs.ansible.com/intro_installation.html) on your host machine, so Drupal VM can run the provisioning steps locally instead of inside the VM.* Note for Linux users: *If NFS is not already installed on your host, you will need to install it to use the default NFS synced folder configuration. See guides for [Debian/Ubuntu](https://www.digitalocean.com/community/tutorials/how-to-set-up-an-nfs-mount-on-ubuntu-14-04), [Arch](https://wiki.archlinux.org/index.php/NFS#Installation), and [RHEL/CentOS](https://www.digitalocean.com/community/tutorials/how-to-set-up-an-nfs-mount-on-centos-6).* -Note on versions: *Please make sure you're running the latest stable version of Vagrant, VirtualBox, and Ansible, as the current version of Drupal VM is tested with the latest releases. As of June 2015: Vagrant 1.7.2, VirtualBox 4.3.26, and Ansible 1.9.2.* +Note on versions: *Please make sure you're running the latest stable version of Vagrant, VirtualBox, and Ansible, as the current version of Drupal VM is tested with the latest releases. As of August 2015: Vagrant 1.7.4, VirtualBox 5.0.2, and Ansible 1.9.2.* ### 2 - Build the Virtual Machine @@ -69,8 +68,9 @@ Note on versions: *Please make sure you're running the latest stable version of - Copy `example.config.yml` to `config.yml`. 3. Create a local directory where Drupal will be installed and configure the path to that directory in `config.yml` (`local_path`, inside `vagrant_synced_folders`). 4. Open Terminal, cd to this directory (containing the `Vagrantfile` and this README file). - 5. [Mac/Linux only] Install Ansible Galaxy roles required for this VM: `$ sudo ansible-galaxy install -r provisioning/requirements.txt --force` - 6. Type in `vagrant up`, and let Vagrant do its magic. + 5. Type in `vagrant up`, and let Vagrant do its magic. + +If you have Ansible installed on your host machine, run `$ sudo ansible-galaxy install -r provisioning/requirements.txt --force` prior to step 5 (`vagrant up`), otherwise Ansible will complain about missing roles. Note: *If there are any errors during the course of running `vagrant up`, and it drops you back to your command prompt, just run `vagrant provision` to continue building the VM from where you left off. If there are still errors after doing this a few times, post an issue to this project's issue queue on GitHub with the error.* From 05e1a882a7cd17c3ccabacc5068e03a426d0bd0f Mon Sep 17 00:00:00 2001 From: Jeff Geerling Date: Wed, 19 Aug 2015 17:21:16 -0700 Subject: [PATCH 0019/1273] Try to format PHP7 docs better. --- docs/other/php-7.md | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/docs/other/php-7.md b/docs/other/php-7.md index fe717a4b4..81659fc71 100644 --- a/docs/other/php-7.md +++ b/docs/other/php-7.md @@ -31,25 +31,25 @@ After configuring Drupal VM to [use a different base OS](https://github.com/geer 1. Make the following changes to `config.yml`: - ```yaml - # Changes to make PHP 7 work in CentOS via Remi's repo. - php_executable: php70 - php_packages: - - ImageMagick - - php70 - - php70-php - - php70-fakepear - - php70-php-devel - - php70-php-gd - - php70-php-imap - - php70-php-ldap - - php70-php-mbstring - - php70-php-pdo - - php70-php-process - - php70-php-xml - - php70-php-xmlrpc - php_mysql_package: php70-php-mysqlnd - ``` + ```yaml + # Changes to make PHP 7 work in CentOS via Remi's repo. + php_executable: php70 + php_packages: + - ImageMagick + - php70 + - php70-php + - php70-fakepear + - php70-php-devel + - php70-php-gd + - php70-php-imap + - php70-php-ldap + - php70-php-mbstring + - php70-php-pdo + - php70-php-process + - php70-php-xml + - php70-php-xmlrpc + php_mysql_package: php70-php-mysqlnd + ``` 2. At this time, automatic install of `xhprof` and `xdebug` are unsupported. Make sure these options are commented or removed from the `installed_extras` setting in `config.yml`. From 1d11628134f9cea0963173bf997cb7748af4479d Mon Sep 17 00:00:00 2001 From: Jeff Geerling Date: Wed, 19 Aug 2015 17:25:06 -0700 Subject: [PATCH 0020/1273] Try to format PHP7 docs better x2. --- docs/other/php-7.md | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/docs/other/php-7.md b/docs/other/php-7.md index 81659fc71..3edc9640c 100644 --- a/docs/other/php-7.md +++ b/docs/other/php-7.md @@ -29,7 +29,19 @@ However, there's currently a bug with the beta1 version of the package, which ca After configuring Drupal VM to [use a different base OS](https://github.com/geerlingguy/drupal-vm/wiki/Using-Different-Base-OSes) (in this case, CentOS 7), you need to do the following to get PHP 7 running inside the VM: - 1. Make the following changes to `config.yml`: + 1. Make the changes to `config.yml` defined in the code block at the end of these instructions ('Changes to make PHP 7 work...'). + + 2. At this time, automatic install of `xhprof` and `xdebug` are unsupported. Make sure these options are commented or removed from the `installed_extras` setting in `config.yml`. + + 3. Run the normal `vagrant up` as you would with PHP 5.x, but when provisioning fails (usually on the Composer step), log into the VM with `vagrant ssh`, and run the following two commands: + ``` + sudo ln -s /usr/bin/php70 /usr/bin/php + sudo systemctl restart httpd.service + ``` + + 4. Log back out (type `exit` to exit the session in the VM) and run `vagrant provision`. This should pick back up where the provisioning left off earlier, and complete installation. + +Note: Make sure you're running the latest version of all Ansible role dependencies by running `ansible-galaxy install -r provisioning/requirements.txt --force` inside the root Drupal VM project folder. ```yaml # Changes to make PHP 7 work in CentOS via Remi's repo. @@ -51,18 +63,6 @@ After configuring Drupal VM to [use a different base OS](https://github.com/geer php_mysql_package: php70-php-mysqlnd ``` - 2. At this time, automatic install of `xhprof` and `xdebug` are unsupported. Make sure these options are commented or removed from the `installed_extras` setting in `config.yml`. - - 3. Run the normal `vagrant up` as you would with PHP 5.x, but when provisioning fails (usually on the Composer step), log into the VM with `vagrant ssh`, and run the following two commands: - ``` - sudo ln -s /usr/bin/php70 /usr/bin/php - sudo systemctl restart httpd.service - ``` - - 4. Log back out (type `exit` to exit the session in the VM) and run `vagrant provision`. This should pick back up where the provisioning left off earlier, and complete installation. - -Note: Make sure you're running the latest version of all Ansible role dependencies by running `ansible-galaxy install -r provisioning/requirements.txt --force` inside the root Drupal VM project folder. - ## Zend nightly PHP 7 builds Zend has a repository with [nightly PHP 7 builds](http://php7.zend.com/repo.php) for either RHEL/CentOS 7 or Debian 8/Ubuntu 14.04, but the repository requires some manual configuration and setup and is not going to be officially supported as a PHP 7 installation method within Drupal VM. \ No newline at end of file From 779f4e80f1dc0c093bde75656127d5db0e91362e Mon Sep 17 00:00:00 2001 From: Jeff Geerling Date: Wed, 19 Aug 2015 19:27:27 -0500 Subject: [PATCH 0021/1273] Try to format PHP7 docs better - code formatting. --- docs/other/php-7.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/docs/other/php-7.md b/docs/other/php-7.md index 3edc9640c..703043603 100644 --- a/docs/other/php-7.md +++ b/docs/other/php-7.md @@ -43,7 +43,6 @@ After configuring Drupal VM to [use a different base OS](https://github.com/geer Note: Make sure you're running the latest version of all Ansible role dependencies by running `ansible-galaxy install -r provisioning/requirements.txt --force` inside the root Drupal VM project folder. - ```yaml # Changes to make PHP 7 work in CentOS via Remi's repo. php_executable: php70 php_packages: @@ -61,7 +60,6 @@ Note: Make sure you're running the latest version of all Ansible role dependenci - php70-php-xml - php70-php-xmlrpc php_mysql_package: php70-php-mysqlnd - ``` ## Zend nightly PHP 7 builds From ca81c740fd9f9d8391c7c8dd4059948bdf2cdcf7 Mon Sep 17 00:00:00 2001 From: Jeff Geerling Date: Fri, 21 Aug 2015 11:00:17 -0500 Subject: [PATCH 0022/1273] Updates to README. --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 58adfb94b..68b33da40 100644 --- a/README.md +++ b/README.md @@ -49,12 +49,12 @@ If you want to switch from Drupal 8 (default) to Drupal 7 or 6 on the initial in This Quick Start Guide will help you quickly build a Drupal 8 site on the Drupal VM using the included example Drush make file. You can also use the Drupal VM with a [Local Drupal codebase](http://docs.drupalvm.com/en/latest/deployment/local-codebase/) or even a [Drupal multisite installation](http://docs.drupalvm.com/en/latest/deployment/multisite/). -### 1 - Install dependencies (VirtualBox, Vagrant, Ansible) +### 1 - Install dependencies (VirtualBox and Vagrant) 1. Download and install [VirtualBox](https://www.virtualbox.org/wiki/Downloads) (Drupal VM also works with Parallels or VMware, if you have the [Vagrant VMware integration plugin](http://www.vagrantup.com/vmware)). 2. Download and install [Vagrant](http://www.vagrantup.com/downloads.html). -Note for Faster Provisioning (Mac/Linux only): *For faster and more efficient provisioning, you should [install Ansible](http://docs.ansible.com/intro_installation.html) on your host machine, so Drupal VM can run the provisioning steps locally instead of inside the VM.* +Note for Faster Provisioning (Mac/Linux only): *[Install Ansible](http://docs.ansible.com/intro_installation.html) on your host machine, so Drupal VM can run the provisioning steps locally instead of inside the VM.* Note for Linux users: *If NFS is not already installed on your host, you will need to install it to use the default NFS synced folder configuration. See guides for [Debian/Ubuntu](https://www.digitalocean.com/community/tutorials/how-to-set-up-an-nfs-mount-on-ubuntu-14-04), [Arch](https://wiki.archlinux.org/index.php/NFS#Installation), and [RHEL/CentOS](https://www.digitalocean.com/community/tutorials/how-to-set-up-an-nfs-mount-on-centos-6).* @@ -70,7 +70,7 @@ Note on versions: *Please make sure you're running the latest stable version of 4. Open Terminal, cd to this directory (containing the `Vagrantfile` and this README file). 5. Type in `vagrant up`, and let Vagrant do its magic. -If you have Ansible installed on your host machine, run `$ sudo ansible-galaxy install -r provisioning/requirements.txt --force` prior to step 5 (`vagrant up`), otherwise Ansible will complain about missing roles. +If you have Ansible installed on your host machine: Run `$ sudo ansible-galaxy install -r provisioning/requirements.txt --force` prior to step 5 (`vagrant up`), otherwise Ansible will complain about missing roles. Note: *If there are any errors during the course of running `vagrant up`, and it drops you back to your command prompt, just run `vagrant provision` to continue building the VM from where you left off. If there are still errors after doing this a few times, post an issue to this project's issue queue on GitHub with the error.* From 994e17feeddbced2ef3a4e93813887b550d717e6 Mon Sep 17 00:00:00 2001 From: Jeff Geerling Date: Fri, 21 Aug 2015 13:00:42 -0500 Subject: [PATCH 0023/1273] Remove ImageMagick from default set of packages to install on RedHat PHP7. --- docs/other/php-7.md | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/other/php-7.md b/docs/other/php-7.md index 703043603..f0f51954e 100644 --- a/docs/other/php-7.md +++ b/docs/other/php-7.md @@ -46,7 +46,6 @@ Note: Make sure you're running the latest version of all Ansible role dependenci # Changes to make PHP 7 work in CentOS via Remi's repo. php_executable: php70 php_packages: - - ImageMagick - php70 - php70-php - php70-fakepear From 6aa5b71a696e0494ae501c4df8b1caba8e8f743f Mon Sep 17 00:00:00 2001 From: Jeff Geerling Date: Fri, 21 Aug 2015 14:44:56 -0500 Subject: [PATCH 0024/1273] Updated PHP 7.0 instructions for Ubuntu 14.04. --- docs/other/php-7.md | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/docs/other/php-7.md b/docs/other/php-7.md index f0f51954e..81df2e477 100644 --- a/docs/other/php-7.md +++ b/docs/other/php-7.md @@ -1,6 +1,6 @@ -Many users have requested the ability to easily install PHP 7.x in addition to the already easy-to-configure options of 5.3, 5.4, 5.5, and 5.6. This page will guide you through how to get PHP 7 running on Drupal VM by modifying a few configuration options and running a couple simple commands inside the VM. +Many users have requested the ability to easily install PHP 7.x in addition to the already easy-to-configure options of 5.3, 5.4, 5.5, and 5.6. This page will guide you through how to get PHP 7 running on Drupal VM in a few different ways, depending on what type of installation you need. -Note that, at this time (summer 2015), PHP 7 is still in pre-beta releases, and all support is experimental and prone to breaking things. Please don't try running PHP 7 on production machines yet! +_At this time (summer 2015), PHP 7 is still in the release candidate stage, and all support is experimental and prone to breaking. Please don't try running PHP 7 on production environments yet!_ ## Ubuntu 14.04 @@ -12,18 +12,15 @@ Otherwise, Ondřej Surý also has a PPA for PHP 7.0 that is included with Drupal php_version: "7.0" php_packages: - libapache2-mod-php7.0 - - php7.0-mcrypt - php7.0-common - php7.0-cli - - php7.0-curl - php7.0-dev - php7.0-fpm - - php7.0-gd - libpcre3-dev php_mysql_package: php7.0-mysqlnd ``` -However, there's currently a bug with the beta1 version of the package, which causes installation to fail (see: https://github.com/oerdnj/deb.sury.org/issues/87). This section will be updated with more information once this packaging bug is fixed or a workaround is found. +However, the PHP MySQL package is currently not available in the repo, so MySQL support is not active (see: https://github.com/oerdnj/deb.sury.org/issues/106). This section will be updated with more information once this problem is fixed or a workaround is found. ## RedHat/CentOS 7 @@ -62,4 +59,4 @@ Note: Make sure you're running the latest version of all Ansible role dependenci ## Zend nightly PHP 7 builds -Zend has a repository with [nightly PHP 7 builds](http://php7.zend.com/repo.php) for either RHEL/CentOS 7 or Debian 8/Ubuntu 14.04, but the repository requires some manual configuration and setup and is not going to be officially supported as a PHP 7 installation method within Drupal VM. \ No newline at end of file +Zend has a repository with [nightly PHP 7 builds](http://php7.zend.com/repo.php) for either RHEL/CentOS 7 or Debian 8/Ubuntu 14.04, but the repository requires some manual configuration and setup and is not going to be officially supported as a PHP 7 installation method within Drupal VM. From a289a4f91724fcd6357eee3f4968f68a856ac33d Mon Sep 17 00:00:00 2001 From: Jeff Geerling Date: Fri, 21 Aug 2015 16:53:36 -0500 Subject: [PATCH 0025/1273] Much simpler PHP 7.0 docs for Ubuntu 14.04. --- docs/other/php-7.md | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/docs/other/php-7.md b/docs/other/php-7.md index 81df2e477..35d969ca4 100644 --- a/docs/other/php-7.md +++ b/docs/other/php-7.md @@ -4,9 +4,7 @@ _At this time (summer 2015), PHP 7 is still in the release candidate stage, and ## Ubuntu 14.04 -Currently the most reliable way to get PHP 7 (any version) running on Ubuntu is to build from source. This is supported by Drupal VM and is not too difficult, but it requires a few manual steps to make sure Apache and PHP play nice together, so this process is not currently documented here. - -Otherwise, Ondřej Surý also has a PPA for PHP 7.0 that is included with Drupal VM, and you can make the following additions/changes to your `config.yml` to use it: +Ondřej Surý's PPA for PHP 7.0 is included with Drupal VM, and you can make the following changes/additions to `config.yml` to use it: ```yaml php_version: "7.0" @@ -17,10 +15,15 @@ php_packages: - php7.0-dev - php7.0-fpm - libpcre3-dev -php_mysql_package: php7.0-mysqlnd + - php-gd + - php-curl + - php-imap + - php-json + - php-opcache +php_mysql_package: php-mysql ``` -However, the PHP MySQL package is currently not available in the repo, so MySQL support is not active (see: https://github.com/oerdnj/deb.sury.org/issues/106). This section will be updated with more information once this problem is fixed or a workaround is found. +Note that there can still be a few inconsistencies with this configuration, especially as PHP 7.0.0 is still in 'release candidate status'. You can also build from source using the same/included `geerlingguy.php` Ansible role, but that process is a bit more involved and for power users comfortable with the process. ## RedHat/CentOS 7 From 70a3436d63c4eebf03d6c6adc1ccbf36aa311772 Mon Sep 17 00:00:00 2001 From: Jeff Geerling Date: Fri, 21 Aug 2015 16:53:58 -0500 Subject: [PATCH 0026/1273] Much faster Drush installation with default install option of --prefer-dist. --- example.config.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/example.config.yml b/example.config.yml index 764230333..9c9cc4502 100644 --- a/example.config.yml +++ b/example.config.yml @@ -109,6 +109,7 @@ extra_security_enabled: false drush_version: master drush_keep_updated: true +drush_composer_cli_options: "--prefer-dist --no-interaction" firewall_allowed_tcp_ports: - "22" From 8045f7deda5c9d02048730844d048d7c1887299d Mon Sep 17 00:00:00 2001 From: Jeff Geerling Date: Mon, 24 Aug 2015 22:34:47 -0500 Subject: [PATCH 0027/1273] Fixes #212: Use KVM paravirtualization instead of Legacy for VirtualBox. --- Vagrantfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Vagrantfile b/Vagrantfile index 7aa27bf97..4ca0a106d 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -87,6 +87,7 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| v.cpus = vconfig['vagrant_cpus'] v.customize ["modifyvm", :id, "--natdnshostresolver1", "on"] v.customize ["modifyvm", :id, "--ioapic", "on"] + v.customize ["modifyvm", :id, "--paravirtprovider", "kvm"] end # Parallels. From 284f2bfd1ca7fd96621b9b8b6b110cd8559f9c0a Mon Sep 17 00:00:00 2001 From: Jeff Geerling Date: Thu, 27 Aug 2015 14:50:08 -0500 Subject: [PATCH 0028/1273] Fixes #216: Install Postfix with geerlingguy.postfix role instead of custom task. --- provisioning/playbook.yml | 1 + provisioning/requirements.txt | 1 + provisioning/tasks/init-debian.yml | 3 --- provisioning/tasks/init-redhat.yml | 3 --- 4 files changed, 2 insertions(+), 6 deletions(-) diff --git a/provisioning/playbook.yml b/provisioning/playbook.yml index 9902105c0..fc6cd3058 100644 --- a/provisioning/playbook.yml +++ b/provisioning/playbook.yml @@ -15,6 +15,7 @@ - { role: geerlingguy.repo-remi, when: ansible_os_family == 'RedHat' } - geerlingguy.firewall - geerlingguy.git + - geerlingguy.postfix - geerlingguy.apache - geerlingguy.mysql - geerlingguy.php diff --git a/provisioning/requirements.txt b/provisioning/requirements.txt index d7e067f24..9aa5244db 100644 --- a/provisioning/requirements.txt +++ b/provisioning/requirements.txt @@ -18,6 +18,7 @@ geerlingguy.php-pecl geerlingguy.php-xdebug geerlingguy.php-xhprof geerlingguy.pimpmylog +geerlingguy.postfix geerlingguy.repo-remi geerlingguy.security geerlingguy.solr diff --git a/provisioning/tasks/init-debian.yml b/provisioning/tasks/init-debian.yml index 1e39ad63e..74f842232 100644 --- a/provisioning/tasks/init-debian.yml +++ b/provisioning/tasks/init-debian.yml @@ -13,9 +13,6 @@ - name: Disable the ufw firewall (since we use a simple iptables firewall). service: name=ufw state=stopped -- name: Install postfix so Drupal can send emails. - apt: name=postfix state=installed - - name: Add repository for PHP 5.5. apt_repository: repo='ppa:ondrej/php5' when: php_version == "5.5" diff --git a/provisioning/tasks/init-redhat.yml b/provisioning/tasks/init-redhat.yml index b4d265efc..b95ca9383 100644 --- a/provisioning/tasks/init-redhat.yml +++ b/provisioning/tasks/init-redhat.yml @@ -6,9 +6,6 @@ - "python-pycurl" - "@development" -- name: Install postfix so Drupal can send emails. - yum: name=postfix state=installed - - name: Enable remi repo for MySQL. set_fact: mysql_enablerepo="remi" From c3922f498659d8ba7d9924fe17e7186dededd070 Mon Sep 17 00:00:00 2001 From: Craig Aschbrenner Date: Thu, 27 Aug 2015 22:26:07 -0400 Subject: [PATCH 0029/1273] Issue #185: Added ability for configuring a public network. --- Vagrantfile | 9 +++++++++ example.config.yml | 9 +++++++++ 2 files changed, 18 insertions(+) diff --git a/Vagrantfile b/Vagrantfile index 4ca0a106d..9ca52c048 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -29,6 +29,15 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| else config.vm.network :private_network, ip: vconfig['vagrant_ip'] end + + if vconfig['vagrant_enable_public_network'] + if vconfig['vagrant_public_ip'] == "0.0.0.0" + config.vm.network :public_network + else + config.vm.network :public_network, ip: vconfig['vagrant_public_ip'] + end + end + config.ssh.insert_key = false config.ssh.forward_agent = true diff --git a/example.config.yml b/example.config.yml index 9c9cc4502..01f6ed5af 100644 --- a/example.config.yml +++ b/example.config.yml @@ -10,6 +10,15 @@ vagrant_hostname: drupalvm.dev vagrant_machine_name: drupalvm vagrant_ip: 192.168.88.88 +# If you need to access this guest from a device other than the host you will +# want to enable public networking. Optionally provide a static IP value. +# Warning! Vagrant boxes are insecure by default and by design, featuring public +# passwords, insecure keypairs for SSH access, and potentially allow root access +# over SSH. +# https://docs.vagrantup.com/v2/networking/public_network.html +vagrant_enable_public_network: false +# vagrant_public_ip: 192.168.1.100 + # A list of synced folders, with the keys 'local_path', 'destination', 'id', and # a 'type' of [nfs|rsync|smb] (leave empty for slow native shares). See # http://docs.drupalvm.com/en/latest/extras/syncing-folders/ for more info. From 802fff24664c97453c8155696eb58c8230696620 Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Tue, 1 Sep 2015 22:01:47 +0100 Subject: [PATCH 0030/1273] Added spaces --- example.config.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/example.config.yml b/example.config.yml index 50d0fc0c4..b367d13b3 100644 --- a/example.config.yml +++ b/example.config.yml @@ -65,9 +65,9 @@ configure_local_drush_aliases: true # Apache VirtualHosts. Add one for each site you are running inside the VM. For # multisite deployments, you can point multiple servernames at one documentroot. apache_vhosts: - - {servername: "{{ drupal_domain }}", documentroot: "{{ drupal_core_path }}"} - - {servername: "xhprof.drupalvm.dev", documentroot: "/usr/share/php/xhprof_html"} - - {servername: "pimpmylog.drupalvm.dev", documentroot: "/usr/share/php/pimpmylog"} + - { servername: "{{ drupal_domain }}", documentroot: "{{ drupal_core_path }}" } + - { servername: "xhprof.drupalvm.dev", documentroot: "/usr/share/php/xhprof_html" } + - { servername: "pimpmylog.drupalvm.dev", documentroot: "/usr/share/php/pimpmylog" } apache_remove_default_vhost: true apache_mods_enabled: - expires.load From 7f5ab08774305fbf4bfeaa9008085165ba7d30be Mon Sep 17 00:00:00 2001 From: TravisCarden Date: Wed, 2 Sep 2015 20:54:21 -0500 Subject: [PATCH 0031/1273] Fixed references to misnamed property "build_from_makefile". --- docs/deployment/local-codebase.md | 2 +- example.config.yml | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/deployment/local-codebase.md b/docs/deployment/local-codebase.md index a70f1870b..047ca54b1 100644 --- a/docs/deployment/local-codebase.md +++ b/docs/deployment/local-codebase.md @@ -17,7 +17,7 @@ vagrant_synced_folders: Set `build_makefile` and `install_site` to `false`: ```yaml -build_from_makefile: false +build_makefile:: false ... install_site: false ``` diff --git a/example.config.yml b/example.config.yml index ff54ea182..206d64885 100644 --- a/example.config.yml +++ b/example.config.yml @@ -15,7 +15,7 @@ vagrant_ip: 192.168.88.88 # http://docs.drupalvm.com/en/latest/extras/syncing-folders/ for more info. vagrant_synced_folders: # The first synced folder will be used for the default Drupal installation, if - # build_from_makefile is 'true'. + # build_makefile: is 'true'. - local_path: ~/Sites/drupalvm destination: /var/www id: drupal @@ -35,7 +35,7 @@ drush_makefile_path: /vagrant/drupal.make.yml # settings below), but instead copy down a database (e.g. using drush sql-sync). install_site: true -# Settings for building a Drupal site from a makefile (if 'build_from_makefile' +# Settings for building a Drupal site from a makefile (if 'build_makefile:' # is 'true'). drupal_major_version: 8 drupal_core_path: "/var/www/drupal" @@ -74,7 +74,7 @@ apache_mods_enabled: - ssl.load - rewrite.load -# MySQL Databases and users. If build_from_makefile is true, first database will +# MySQL Databases and users. If build_makefile: is true, first database will # be used for the makefile-built site. mysql_databases: - name: "{{ drupal_mysql_database }}" From 8be94e7144537e5c2701b1a271bcfa53fb4c2245 Mon Sep 17 00:00:00 2001 From: TravisCarden Date: Thu, 3 Sep 2015 10:49:26 -0500 Subject: [PATCH 0032/1273] PR #111: Replace phpMyAdmin documentation with Adminer. --- docs/extras/mysql.md | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/docs/extras/mysql.md b/docs/extras/mysql.md index 7deffafc0..1769ca84a 100644 --- a/docs/extras/mysql.md +++ b/docs/extras/mysql.md @@ -1,12 +1,10 @@ By default, this VM is set up so you can manage MySQL databases on your own. The default root MySQL user credentials are `root` for username and password, but you can change the password via `config.yml` (changing the `mysql_root_password` variable). I use the [Sequel Pro](http://www.sequelpro.com/) (Mac-only) to connect and manage databases, and Drush to sync databases (sometimes I'll just do a dump and import, but Drush is usually quicker, and is easier to do over and over again when you need it). -## Connect using phpMyAdmin +## Connect using Adminer -If you have `phpmyadmin` listed as one of the `installed_extras` inside `config.yml`, you can use phpMyAdmin's web-based interface to interact with databases. With Drupal VM running, visit `http://drupaltest.dev/phpmyadmin/`, and log in with `root` as the username and the password you set in `config.yml` (`mysql_root_password`). +If you have `adminer` listed as one of the `installed_extras` inside `config.yml`, you can use Adminer's web-based interface to interact with databases. With Drupal VM running, visit `http://drupalvm.dev/adminer/`, and log in with `root` as the username and the password you set in `config.yml` (`mysql_root_password`). Leave the "Server" field blank. The "Database" field is optional. -More about how to use phpMyAdmin: [phpMyAdmin documentation](http://docs.phpmyadmin.net/). - -_Note_: If you get the error `#1146 - Table 'phpmyadmin.pma_table_uiprefs' doesn't exist` when browsing tables in phpMyAdmin, please log into the VM using `vagrant ssh`, then run the command `sudo dpkg-reconfigure phpmyadmin`, and follow the onscreen prompts. This error is caused by [a bug in phpMyAdmin's Ubuntu package installation](https://github.com/geerlingguy/ansible-role-phpmyadmin/issues/1#issuecomment-92461536). +More about how to use Admier: [Adminer website](http://www.adminer.org/). ## Connect using Sequel Pro (or a similar client): From e67ae2c2fa10b25ac9581f9bc1301a713925c27f Mon Sep 17 00:00:00 2001 From: Jeff Geerling Date: Thu, 3 Sep 2015 17:14:18 -0500 Subject: [PATCH 0033/1273] Cleaner apache_vhosts example. --- example.config.yml | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/example.config.yml b/example.config.yml index 206d64885..190fc7aca 100644 --- a/example.config.yml +++ b/example.config.yml @@ -64,10 +64,17 @@ configure_local_drush_aliases: true # Apache VirtualHosts. Add one for each site you are running inside the VM. For # multisite deployments, you can point multiple servernames at one documentroot. +# View the geerlingguy.apache Ansible Role README for more options. apache_vhosts: - - { servername: "{{ drupal_domain }}", documentroot: "{{ drupal_core_path }}" } - - { servername: "xhprof.drupalvm.dev", documentroot: "/usr/share/php/xhprof_html" } - - { servername: "pimpmylog.drupalvm.dev", documentroot: "/usr/share/php/pimpmylog" } + - servername: "{{ drupal_domain }}" + documentroot: "{{ drupal_core_path }}" + + - servername: "xhprof.drupalvm.dev" + documentroot: "/usr/share/php/xhprof_html" + + - servername: "pimpmylog.drupalvm.dev" + documentroot: "/usr/share/php/pimpmylog" + apache_remove_default_vhost: true apache_mods_enabled: - expires.load From 39024021bdee86cf65f33caf3fc62966f6f5360b Mon Sep 17 00:00:00 2001 From: Jeff Geerling Date: Fri, 4 Sep 2015 14:42:11 -0500 Subject: [PATCH 0034/1273] Issue #227: Add optional Node.js installation option. --- example.config.yml | 1 + provisioning/playbook.yml | 1 + provisioning/requirements.txt | 1 + 3 files changed, 3 insertions(+) diff --git a/example.config.yml b/example.config.yml index 190fc7aca..f98186681 100644 --- a/example.config.yml +++ b/example.config.yml @@ -100,6 +100,7 @@ installed_extras: - adminer - mailhog - memcached + # - nodejs - pimpmylog # - selenium # - solr diff --git a/provisioning/playbook.yml b/provisioning/playbook.yml index fc6cd3058..124735dfb 100644 --- a/provisioning/playbook.yml +++ b/provisioning/playbook.yml @@ -34,6 +34,7 @@ - { role: geerlingguy.pimpmylog, when: '"pimpmylog" in installed_extras' } - { role: geerlingguy.daemonize, when: '"mailhog" in installed_extras' } - { role: geerlingguy.mailhog, when: '"mailhog" in installed_extras' } + - { role: geerlingguy.nodejs, when: '"nodejs" in installed_extras' } - { role: geerlingguy.java, when: '"solr" in installed_extras or "selenium" in installed_extras' } - { role: arknoll.selenium, when: '"selenium" in installed_extras' } - { role: geerlingguy.solr, when: '"solr" in installed_extras' } diff --git a/provisioning/requirements.txt b/provisioning/requirements.txt index 9aa5244db..94cf3c171 100644 --- a/provisioning/requirements.txt +++ b/provisioning/requirements.txt @@ -11,6 +11,7 @@ geerlingguy.java geerlingguy.mailhog geerlingguy.memcached geerlingguy.mysql +geerlingguy.nodejs geerlingguy.php geerlingguy.php-memcached geerlingguy.php-mysql From 39f644c465e581ee10954ddb8286e54a3d1df4f8 Mon Sep 17 00:00:00 2001 From: Jeff Geerling Date: Fri, 4 Sep 2015 14:43:15 -0500 Subject: [PATCH 0035/1273] Issue #227: Add optional Ruby installation option. --- example.config.yml | 1 + provisioning/playbook.yml | 1 + provisioning/requirements.txt | 1 + 3 files changed, 3 insertions(+) diff --git a/example.config.yml b/example.config.yml index f98186681..000f89e6f 100644 --- a/example.config.yml +++ b/example.config.yml @@ -102,6 +102,7 @@ installed_extras: - memcached # - nodejs - pimpmylog + # - ruby # - selenium # - solr - varnish diff --git a/provisioning/playbook.yml b/provisioning/playbook.yml index 124735dfb..86adb74de 100644 --- a/provisioning/playbook.yml +++ b/provisioning/playbook.yml @@ -35,6 +35,7 @@ - { role: geerlingguy.daemonize, when: '"mailhog" in installed_extras' } - { role: geerlingguy.mailhog, when: '"mailhog" in installed_extras' } - { role: geerlingguy.nodejs, when: '"nodejs" in installed_extras' } + - { role: geerlingguy.ruby, when: '"ruby" in installed_extras' } - { role: geerlingguy.java, when: '"solr" in installed_extras or "selenium" in installed_extras' } - { role: arknoll.selenium, when: '"selenium" in installed_extras' } - { role: geerlingguy.solr, when: '"solr" in installed_extras' } diff --git a/provisioning/requirements.txt b/provisioning/requirements.txt index 94cf3c171..8a2056d84 100644 --- a/provisioning/requirements.txt +++ b/provisioning/requirements.txt @@ -21,6 +21,7 @@ geerlingguy.php-xhprof geerlingguy.pimpmylog geerlingguy.postfix geerlingguy.repo-remi +geerlingguy.ruby geerlingguy.security geerlingguy.solr geerlingguy.varnish From f40db4a23dafcd3ee2ecbdc8890e2a43b0339fb0 Mon Sep 17 00:00:00 2001 From: Jeff Geerling Date: Fri, 4 Sep 2015 15:19:38 -0500 Subject: [PATCH 0036/1273] Issue #227: Add config examples for Ruby gems and NPM packages. --- example.config.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/example.config.yml b/example.config.yml index 000f89e6f..da1925dfa 100644 --- a/example.config.yml +++ b/example.config.yml @@ -113,6 +113,12 @@ installed_extras: extra_packages: - unzip +# `nodejs` must be in installed_extras for this to work. +nodejs_npm_global_packages: [] + +# `ruby` must be in installed_extras for this to work. +ruby_install_gems: [] + # You can configure almost anything else on the server in the rest of this file. extra_security_enabled: false From 1d3c158dcd4e00a775cb540b257a2e44f5bca412 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oskar=20Sch=C3=B6ldstr=C3=B6m?= Date: Sat, 4 Jul 2015 11:23:32 -0500 Subject: [PATCH 0037/1273] Add drupal install arguments configuration option --- example.config.yml | 3 +++ provisioning/tasks/install-site.yml | 1 + 2 files changed, 4 insertions(+) diff --git a/example.config.yml b/example.config.yml index 125ef8d23..dd29b6fb2 100644 --- a/example.config.yml +++ b/example.config.yml @@ -49,6 +49,9 @@ drupal_mysql_user: drupal drupal_mysql_password: drupal drupal_mysql_database: drupal +# Additional arguments or options to pass to `drush site-install`. +drupal_site_install_extra_args: [] + # Cron jobs are added to the root user's crontab. Keys include name (required), # minute, hour, day, weekday, month, job (required), and state. drupalvm_cron_jobs: [] diff --git a/provisioning/tasks/install-site.yml b/provisioning/tasks/install-site.yml index 9ee4df24b..b91c0e08d 100644 --- a/provisioning/tasks/install-site.yml +++ b/provisioning/tasks/install-site.yml @@ -15,6 +15,7 @@ --account-name={{ drupal_account_name }} --account-pass={{ drupal_account_pass }} --db-url=mysql://{{ drupal_mysql_user }}:{{ drupal_mysql_password }}@localhost/{{ mysql_databases[0].name }} + {{ drupal_site_install_extra_args | default([]) | join(" ") }} chdir={{ drupal_core_path }} notify: restart webserver when: "'Successful' not in drupal_site_installed.stdout" From e4059a4f522df9c1891281ac3a77a52f9c56642e Mon Sep 17 00:00:00 2001 From: Craig Aschbrenner Date: Sat, 5 Sep 2015 17:35:12 -0400 Subject: [PATCH 0038/1273] Reduced variables and updated logic based on original PR feedback. --- Vagrantfile | 10 ++++------ example.config.yml | 12 ++++-------- 2 files changed, 8 insertions(+), 14 deletions(-) diff --git a/Vagrantfile b/Vagrantfile index 9ca52c048..785b11c76 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -30,12 +30,10 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| config.vm.network :private_network, ip: vconfig['vagrant_ip'] end - if vconfig['vagrant_enable_public_network'] - if vconfig['vagrant_public_ip'] == "0.0.0.0" - config.vm.network :public_network - else - config.vm.network :public_network, ip: vconfig['vagrant_public_ip'] - end + if !vconfig['vagrant_public_ip'].empty? && vconfig['vagrant_public_ip'] == "0.0.0.0" + config.vm.network :public_network + elsif !vconfig['vagrant_public_ip'].empty? + config.vm.network :public_network, ip: vconfig['vagrant_public_ip'] end config.ssh.insert_key = false diff --git a/example.config.yml b/example.config.yml index 01f6ed5af..1ebe369e9 100644 --- a/example.config.yml +++ b/example.config.yml @@ -10,14 +10,10 @@ vagrant_hostname: drupalvm.dev vagrant_machine_name: drupalvm vagrant_ip: 192.168.88.88 -# If you need to access this guest from a device other than the host you will -# want to enable public networking. Optionally provide a static IP value. -# Warning! Vagrant boxes are insecure by default and by design, featuring public -# passwords, insecure keypairs for SSH access, and potentially allow root access -# over SSH. -# https://docs.vagrantup.com/v2/networking/public_network.html -vagrant_enable_public_network: false -# vagrant_public_ip: 192.168.1.100 +# Allow Drupal VM to be accessed via a network interface on your host by setting +# the IP address here. Vagrant boxes are insecure by default, so be careful +# exposing Drupal VM to the outside world. You've been warned! +vagrant_public_ip: "" # A list of synced folders, with the keys 'local_path', 'destination', 'id', and # a 'type' of [nfs|rsync|smb] (leave empty for slow native shares). See From b914a6ea4ad96dba0688280b738a6f5c93b05223 Mon Sep 17 00:00:00 2001 From: Travis Carden Date: Sun, 6 Sep 2015 14:19:57 -0500 Subject: [PATCH 0039/1273] Fix typo in mysql.md. --- docs/extras/mysql.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/extras/mysql.md b/docs/extras/mysql.md index 1769ca84a..e3b985813 100644 --- a/docs/extras/mysql.md +++ b/docs/extras/mysql.md @@ -4,7 +4,7 @@ By default, this VM is set up so you can manage MySQL databases on your own. The If you have `adminer` listed as one of the `installed_extras` inside `config.yml`, you can use Adminer's web-based interface to interact with databases. With Drupal VM running, visit `http://drupalvm.dev/adminer/`, and log in with `root` as the username and the password you set in `config.yml` (`mysql_root_password`). Leave the "Server" field blank. The "Database" field is optional. -More about how to use Admier: [Adminer website](http://www.adminer.org/). +More about how to use Adminer: [Adminer website](http://www.adminer.org/). ## Connect using Sequel Pro (or a similar client): @@ -17,4 +17,4 @@ More about how to use Admier: [Adminer website](http://www.adminer.org/). - SSH User: `vagrant` - SSH Key: (browse to your `~/.vagrant.d/` folder and choose `insecure_private_key`) -You should be able to connect as the root user and add, manage, and remove databases and users. \ No newline at end of file +You should be able to connect as the root user and add, manage, and remove databases and users. From 0cf3b272b2bb3d033dfeb8dedf15a9e453cdc6f3 Mon Sep 17 00:00:00 2001 From: "Robert L. Huffstedtler" Date: Sun, 6 Sep 2015 18:35:38 -0400 Subject: [PATCH 0040/1273] Added PowerShell details for Windows 7 --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 68b33da40..238eb32d4 100644 --- a/README.md +++ b/README.md @@ -58,8 +58,11 @@ Note for Faster Provisioning (Mac/Linux only): *[Install Ansible](http://docs.an Note for Linux users: *If NFS is not already installed on your host, you will need to install it to use the default NFS synced folder configuration. See guides for [Debian/Ubuntu](https://www.digitalocean.com/community/tutorials/how-to-set-up-an-nfs-mount-on-ubuntu-14-04), [Arch](https://wiki.archlinux.org/index.php/NFS#Installation), and [RHEL/CentOS](https://www.digitalocean.com/community/tutorials/how-to-set-up-an-nfs-mount-on-centos-6).* +Note for Windows 7 users: *Windows 7 ships with PowerShell 2.0. If vagrant up hangs for you, you may need to upgrade to PowerShell 4.0 which is part of the [Windows Management Framework](http://www.microsoft.com/en-us/download/details.aspx?id=40855). + Note on versions: *Please make sure you're running the latest stable version of Vagrant, VirtualBox, and Ansible, as the current version of Drupal VM is tested with the latest releases. As of August 2015: Vagrant 1.7.4, VirtualBox 5.0.2, and Ansible 1.9.2.* + ### 2 - Build the Virtual Machine 1. Download this project and put it wherever you want. From cd5c313b536d3e55a6c340790c782d086ecbb971 Mon Sep 17 00:00:00 2001 From: Jeff Geerling Date: Sun, 6 Sep 2015 23:03:44 -0500 Subject: [PATCH 0041/1273] Clearer documentation of public networking option from PR #217. --- example.config.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/example.config.yml b/example.config.yml index 8913d5e99..cb284116d 100644 --- a/example.config.yml +++ b/example.config.yml @@ -10,9 +10,9 @@ vagrant_hostname: drupalvm.dev vagrant_machine_name: drupalvm vagrant_ip: 192.168.88.88 -# Allow Drupal VM to be accessed via a network interface on your host by setting -# the IP address here. Vagrant boxes are insecure by default, so be careful -# exposing Drupal VM to the outside world. You've been warned! +# Allow Drupal VM to be accessed via a public network interface on your host. +# Vagrant boxes are insecure by default, so be careful. You've been warned! +# See: https://docs.vagrantup.com/v2/networking/public_network.html vagrant_public_ip: "" # A list of synced folders, with the keys 'local_path', 'destination', 'id', and From 77fe4995f6a62b3e9b9fea2b6ace831e7a150bcb Mon Sep 17 00:00:00 2001 From: "Robert L. Huffstedtler" Date: Mon, 7 Sep 2015 11:01:32 -0400 Subject: [PATCH 0042/1273] Moved PowerShell note to docs\other\windows --- README.md | 2 -- docs/other/windows.md | 3 +++ 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 238eb32d4..6f5d8b01a 100644 --- a/README.md +++ b/README.md @@ -58,8 +58,6 @@ Note for Faster Provisioning (Mac/Linux only): *[Install Ansible](http://docs.an Note for Linux users: *If NFS is not already installed on your host, you will need to install it to use the default NFS synced folder configuration. See guides for [Debian/Ubuntu](https://www.digitalocean.com/community/tutorials/how-to-set-up-an-nfs-mount-on-ubuntu-14-04), [Arch](https://wiki.archlinux.org/index.php/NFS#Installation), and [RHEL/CentOS](https://www.digitalocean.com/community/tutorials/how-to-set-up-an-nfs-mount-on-centos-6).* -Note for Windows 7 users: *Windows 7 ships with PowerShell 2.0. If vagrant up hangs for you, you may need to upgrade to PowerShell 4.0 which is part of the [Windows Management Framework](http://www.microsoft.com/en-us/download/details.aspx?id=40855). - Note on versions: *Please make sure you're running the latest stable version of Vagrant, VirtualBox, and Ansible, as the current version of Drupal VM is tested with the latest releases. As of August 2015: Vagrant 1.7.4, VirtualBox 5.0.2, and Ansible 1.9.2.* diff --git a/docs/other/windows.md b/docs/other/windows.md index 5ed4a803d..b74c688cc 100644 --- a/docs/other/windows.md +++ b/docs/other/windows.md @@ -32,3 +32,6 @@ Some Windows users have reported running into an issue where an authentication f 1. Delete `~/.vagrant.d/insecure_private_key` 2. Run `vagrant ssh-config` 3. Restart the VM with `vagrant reload` + +### Required PowerShell Version +If you are running Windows 7 and vagrant up hangs, you may need to upgrade PowerShell. Windows 7 ships with PowerShell 2.0, but PowerShell 3.0 or higher is needed. For Windows 7, you can upgrade to PowerShell 4.0 which is part of the [Windows Management Framework](http://www.microsoft.com/en-us/download/details.aspx?id=40855). From 43da06d92316eebb2abbecd813a4d5dc74a279fc Mon Sep 17 00:00:00 2001 From: Jeff Geerling Date: Wed, 9 Sep 2015 10:23:39 -0500 Subject: [PATCH 0043/1273] Issue #210: Remove id from example shares, as it causes more problems than it solves. --- example.config.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/example.config.yml b/example.config.yml index b0a4c186c..577f9504a 100644 --- a/example.config.yml +++ b/example.config.yml @@ -23,7 +23,6 @@ vagrant_synced_folders: # build_makefile: is 'true'. - local_path: ~/Sites/drupalvm destination: /var/www - id: drupal type: nfs create: true From 70b3e9e3b88a31aec13edd913ee4fcf7a1e599fe Mon Sep 17 00:00:00 2001 From: Jeff Geerling Date: Mon, 14 Sep 2015 10:19:04 -0500 Subject: [PATCH 0044/1273] Issue #227: Specify latest stable version of Node.js by default. --- example.config.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/example.config.yml b/example.config.yml index 577f9504a..ca2a0aae4 100644 --- a/example.config.yml +++ b/example.config.yml @@ -121,6 +121,7 @@ extra_packages: - unzip # `nodejs` must be in installed_extras for this to work. +nodejs_version: "0.12" nodejs_npm_global_packages: [] # `ruby` must be in installed_extras for this to work. From d7b8db396406ead299bc8973b96f6bae89430e82 Mon Sep 17 00:00:00 2001 From: Joe Stewart Date: Mon, 14 Sep 2015 13:37:39 -0500 Subject: [PATCH 0045/1273] Display DrupalVM logo using Markdown. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 68b33da40..9c1bd62c1 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -

Drupal VM Logo

+![Drupal VM Logo](https://raw.githubusercontent.com/geerlingguy/drupal-vm/master/docs/images/drupal-vm-logo.png) [![Build Status](https://travis-ci.org/geerlingguy/drupal-vm.svg?branch=master)](https://travis-ci.org/geerlingguy/drupal-vm) [![Documentation Status](https://readthedocs.org/projects/drupal-vm/badge/?version=latest)](http://docs.drupalvm.com) From d1fc24c8ad73ff96ce5d08e902cc151d6d95f96a Mon Sep 17 00:00:00 2001 From: Jeff Geerling Date: Mon, 21 Sep 2015 13:22:23 -0500 Subject: [PATCH 0046/1273] Fixes #249: Remove special setting for KVM virtualization. --- Vagrantfile | 1 - 1 file changed, 1 deletion(-) diff --git a/Vagrantfile b/Vagrantfile index 785b11c76..fe2e8bbfd 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -94,7 +94,6 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| v.cpus = vconfig['vagrant_cpus'] v.customize ["modifyvm", :id, "--natdnshostresolver1", "on"] v.customize ["modifyvm", :id, "--ioapic", "on"] - v.customize ["modifyvm", :id, "--paravirtprovider", "kvm"] end # Parallels. From 041b5f6c3351d6b6ead7c668358a5df438d3321c Mon Sep 17 00:00:00 2001 From: Jeff Geerling Date: Mon, 21 Sep 2015 22:25:41 -0500 Subject: [PATCH 0047/1273] Issue #89: Add Nginx support to Drupal VM. --- example.config.yml | 18 +++++ provisioning/playbook.yml | 5 +- provisioning/requirements.txt | 1 + provisioning/tasks/nginx.yml | 12 +++ provisioning/tasks/www.yml | 1 + provisioning/templates/nginx-vhost.conf.j2 | 93 ++++++++++++++++++++++ 6 files changed, 129 insertions(+), 1 deletion(-) create mode 100644 provisioning/tasks/nginx.yml create mode 100644 provisioning/templates/nginx-vhost.conf.j2 diff --git a/example.config.yml b/example.config.yml index ca2a0aae4..24c197d07 100644 --- a/example.config.yml +++ b/example.config.yml @@ -30,6 +30,9 @@ vagrant_synced_folders: vagrant_memory: 1024 vagrant_cpus: 2 +# The web server software to use. Can be either 'apache' or 'nginx'. +drupalvm_webserver: apache + # Set this to false if you are using a different site deployment strategy and # would like to configure 'vagrant_synced_folders' and 'apache_vhosts' manually. build_makefile: true @@ -88,6 +91,21 @@ apache_mods_enabled: - ssl.load - rewrite.load +# Nginx hosts. Each site will get a server entry using the configuration defined +# here. Set the 'is_drupal' property to true to use a Drupal-optimized Nginx +# virtual host configuration. +nginx_hosts: + - listen: "80 default_server" + server_name: "{{ drupal_domain }}" + root: "{{ drupal_core_path }}" + is_drupal: true + + - listen: "80" + server_name: "pimpmylog.drupalvm.dev" + root: "/usr/share/php/pimpmylog" + +nginx_remove_default_vhost: true + # MySQL Databases and users. If build_makefile: is true, first database will # be used for the makefile-built site. mysql_databases: diff --git a/provisioning/playbook.yml b/provisioning/playbook.yml index 86adb74de..fe10dd20f 100644 --- a/provisioning/playbook.yml +++ b/provisioning/playbook.yml @@ -16,7 +16,8 @@ - geerlingguy.firewall - geerlingguy.git - geerlingguy.postfix - - geerlingguy.apache + - { role: geerlingguy.apache, when: drupalvm_webserver == 'apache' } + - { role: geerlingguy.nginx, when: drupalvm_webserver == 'nginx' } - geerlingguy.mysql - geerlingguy.php - geerlingguy.php-pecl @@ -52,6 +53,8 @@ - include: tasks/sshd.yml - include: tasks/extras.yml - include: tasks/www.yml + - include: tasks/nginx.yml + when: drupalvm_webserver == 'nginx' - include: tasks/apparmor.yml when: ansible_os_family == 'Debian' diff --git a/provisioning/requirements.txt b/provisioning/requirements.txt index 8a2056d84..17b866e16 100644 --- a/provisioning/requirements.txt +++ b/provisioning/requirements.txt @@ -11,6 +11,7 @@ geerlingguy.java geerlingguy.mailhog geerlingguy.memcached geerlingguy.mysql +geerlingguy.nginx geerlingguy.nodejs geerlingguy.php geerlingguy.php-memcached diff --git a/provisioning/tasks/nginx.yml b/provisioning/tasks/nginx.yml new file mode 100644 index 000000000..3b41d7923 --- /dev/null +++ b/provisioning/tasks/nginx.yml @@ -0,0 +1,12 @@ +--- +# TODO - Make this work with CentOS / RHEL! +- name: Copy Nginx vhosts into place. + template: + src: ../templates/nginx-vhost.conf.j2 + dest: "/etc/nginx/sites-enabled/{{ item.server_name }}.conf" + force: yes + owner: root + group: root + mode: 0644 + with_items: nginx_hosts + notify: restart nginx diff --git a/provisioning/tasks/www.yml b/provisioning/tasks/www.yml index d1b23d07d..8fed05c83 100644 --- a/provisioning/tasks/www.yml +++ b/provisioning/tasks/www.yml @@ -21,3 +21,4 @@ state: directory mode: 0755 recurse: true + when: drupalvm_webserver == 'apache' diff --git a/provisioning/templates/nginx-vhost.conf.j2 b/provisioning/templates/nginx-vhost.conf.j2 new file mode 100644 index 000000000..b0fdca0cf --- /dev/null +++ b/provisioning/templates/nginx-vhost.conf.j2 @@ -0,0 +1,93 @@ +{% if item.server_name_redirect is defined %} +server { + listen 80; + server_name {{ item.server_name_redirect }}; + return 301 http://{{ item.server_name }}$request_uri; +} +{% endif %} + +server { + listen {{ item.listen }}; + + server_name {{ item.server_name }}; + error_log /var/log/nginx/error.log info; + root {{ item.root }}; + index index.php index.html index.htm; + +{% if item.is_drupal is defined and item.is_drupal %} + location / { + # Don't touch PHP for static content. + try_files $uri @rewrite; + } + + # Use fastcgi for all php files. + location ~ \.php$ { + # Secure *.php files. + try_files $uri = 404; + fastcgi_split_path_info ^(.+\.php)(/.+)$; + + fastcgi_pass unix:/var/run/php5-fpm.sock; + fastcgi_index index.php; + fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; + fastcgi_read_timeout 120; + include fastcgi_params; + } + + location @rewrite { + # For D7 and above: + rewrite ^ /index.php; + + # For Drupal 6 and below: + #rewrite ^/(.*)$ /index.php?q=$1; + } + + location ~ ^/sites/.*/files/styles/ { + try_files $uri @rewrite; + } + + location = /favicon.ico { + log_not_found off; + access_log off; + } + + location = /robots.txt { + allow all; + log_not_found off; + access_log off; + } + + location ~ (^|/)\. { + return 403; + } + + location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ { + expires max; + log_not_found off; + } +{% endif %} + + gzip on; + gzip_proxied any; + gzip_static on; + gzip_http_version 1.0; + gzip_disable "MSIE [1-6]\."; + gzip_vary on; + gzip_comp_level 6; + gzip_types + text/plain + text/css + text/xml + text/javascript + application/javascript + application/x-javascript + application/json + application/xml + application/xml+rss + application/xhtml+xml + application/x-font-ttf + application/x-font-opentype + image/svg+xml + image/x-icon; + gzip_buffers 16 8k; + gzip_min_length 512; +} From a24a3b82efc44df4c0c360ac9c68bdc8198ba944 Mon Sep 17 00:00:00 2001 From: Jeff Geerling Date: Mon, 21 Sep 2015 22:53:00 -0500 Subject: [PATCH 0048/1273] Issue #89: Cleaner implementation of Nginx hosts and config. --- Vagrantfile | 18 +++++++++++++----- example.config.yml | 17 ++++++++++------- provisioning/playbook.yml | 2 -- provisioning/tasks/nginx.yml | 12 ------------ provisioning/tasks/www.yml | 12 ++++++++++++ provisioning/templates/nginx-vhost.conf.j2 | 4 ++-- 6 files changed, 37 insertions(+), 28 deletions(-) delete mode 100644 provisioning/tasks/nginx.yml diff --git a/Vagrantfile b/Vagrantfile index fe2e8bbfd..7409b5976 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -41,13 +41,21 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| config.vm.box = vconfig['vagrant_box'] - # If hostsupdater plugin is installed, add all servernames as aliases. + # If hostsupdater plugin is installed, add all server names as aliases. if Vagrant.has_plugin?("vagrant-hostsupdater") config.hostsupdater.aliases = [] - for host in vconfig['apache_vhosts'] - # Add all the hosts that aren't defined as Ansible vars. - unless host['servername'].include? "{{" - config.hostsupdater.aliases.push(host['servername']) + # Add all hosts that aren't defined as Ansible vars. + if vconfig['drupalvm_webserver'] == "apache" + for host in vconfig['apache_vhosts'] + unless host['servername'].include? "{{" + config.hostsupdater.aliases.push(host['servername']) + end + end + else + for host in vconfig['nginx_hosts'] + unless host['server_name'].include? "{{" + config.hostsupdater.aliases.push(host['server_name']) + end end end end diff --git a/example.config.yml b/example.config.yml index 24c197d07..82bf2a436 100644 --- a/example.config.yml +++ b/example.config.yml @@ -92,17 +92,20 @@ apache_mods_enabled: - rewrite.load # Nginx hosts. Each site will get a server entry using the configuration defined -# here. Set the 'is_drupal' property to true to use a Drupal-optimized Nginx -# virtual host configuration. +# here. Set the 'is_php' property for document roots that contain PHP apps like +# Drupal. nginx_hosts: - - listen: "80 default_server" - server_name: "{{ drupal_domain }}" + - server_name: "{{ drupal_domain }}" root: "{{ drupal_core_path }}" - is_drupal: true + is_php: true - - listen: "80" - server_name: "pimpmylog.drupalvm.dev" + - server_name: "xhprof.drupalvm.dev" + root: "/usr/share/php/xhprof_html" + is_php: true + + - server_name: "pimpmylog.drupalvm.dev" root: "/usr/share/php/pimpmylog" + is_php: true nginx_remove_default_vhost: true diff --git a/provisioning/playbook.yml b/provisioning/playbook.yml index fe10dd20f..60b00def0 100644 --- a/provisioning/playbook.yml +++ b/provisioning/playbook.yml @@ -53,8 +53,6 @@ - include: tasks/sshd.yml - include: tasks/extras.yml - include: tasks/www.yml - - include: tasks/nginx.yml - when: drupalvm_webserver == 'nginx' - include: tasks/apparmor.yml when: ansible_os_family == 'Debian' diff --git a/provisioning/tasks/nginx.yml b/provisioning/tasks/nginx.yml deleted file mode 100644 index 3b41d7923..000000000 --- a/provisioning/tasks/nginx.yml +++ /dev/null @@ -1,12 +0,0 @@ ---- -# TODO - Make this work with CentOS / RHEL! -- name: Copy Nginx vhosts into place. - template: - src: ../templates/nginx-vhost.conf.j2 - dest: "/etc/nginx/sites-enabled/{{ item.server_name }}.conf" - force: yes - owner: root - group: root - mode: 0644 - with_items: nginx_hosts - notify: restart nginx diff --git a/provisioning/tasks/www.yml b/provisioning/tasks/www.yml index 8fed05c83..159b709ec 100644 --- a/provisioning/tasks/www.yml +++ b/provisioning/tasks/www.yml @@ -22,3 +22,15 @@ mode: 0755 recurse: true when: drupalvm_webserver == 'apache' + +- name: Copy Nginx vhosts into place. + template: + src: ../templates/nginx-vhost.conf.j2 + dest: "{{ nginx_vhost_path }}/{{ item.server_name }}.conf" + force: yes + owner: root + group: root + mode: 0644 + with_items: nginx_hosts + notify: restart nginx + when: drupalvm_webserver == 'nginx' diff --git a/provisioning/templates/nginx-vhost.conf.j2 b/provisioning/templates/nginx-vhost.conf.j2 index b0fdca0cf..ef1d24685 100644 --- a/provisioning/templates/nginx-vhost.conf.j2 +++ b/provisioning/templates/nginx-vhost.conf.j2 @@ -7,14 +7,14 @@ server { {% endif %} server { - listen {{ item.listen }}; + listen {{ item.listen | default("80") }}; server_name {{ item.server_name }}; error_log /var/log/nginx/error.log info; root {{ item.root }}; index index.php index.html index.htm; -{% if item.is_drupal is defined and item.is_drupal %} +{% if item.is_php is defined and item.is_php %} location / { # Don't touch PHP for static content. try_files $uri @rewrite; From 6430c22232c89cacbf90d64996b71c75818c9197 Mon Sep 17 00:00:00 2001 From: Jeff Geerling Date: Mon, 21 Sep 2015 23:02:05 -0500 Subject: [PATCH 0049/1273] Issue #89: Add Nginx and Apache webserver configuration documentation. --- docs/other/webservers.md | 17 +++++++++++++++++ mkdocs.yml | 1 + 2 files changed, 18 insertions(+) create mode 100644 docs/other/webservers.md diff --git a/docs/other/webservers.md b/docs/other/webservers.md new file mode 100644 index 000000000..1609cbbf4 --- /dev/null +++ b/docs/other/webservers.md @@ -0,0 +1,17 @@ +Drupal VM's configuration works with multiple operating systems _and_ with multiple webservers. You can switch between Apache and Nginx (depending on which server you prefer) with ease. + +All you need to do is change the `drupalvm_webserver` variable inside your customized `config.yml`, choosing either `apache` or `nginx`. + +Because the webservers are configured somewhat differently, there are a few things you should configure depending on which webserver you use. + +## Using Apache + +You have complete control over all aspects of Apache VirtualHosts using the `apache_vhosts` configuration. A few simple examples are shown in `example.config.yml`, but this configuration can be much more complex. + +See the examples included in the [`geerlingguy.apache`](https://github.com/geerlingguy/ansible-role-apache) Ansible role's README for more info, as well as many other variables you can override to configure Apache exactly how you like it. + +## Using Nginx + +Because Nginx server directives behave a little differently than Apache's VirtualHosts, Drupal VM includes a custom Drupal-optimized Nginx server block configuration, and you can control all the servers ('virtual hosts') Nginx will run using the `nginx_hosts` configuration. A few simple examples are shown in `example.config.yml`, but you have some extra flexibility if you need it. See the `nginx-vhost.conf.j2` template for more information. + +Also, see the examples included in the [`geerlingguy.nginx`](https://github.com/geerlingguy/ansible-role-nginx) Ansible role's README for more info, as well as many other variables you can override to configure Nginx exactly how you like it. diff --git a/mkdocs.yml b/mkdocs.yml index f8721d58a..62b9a8aca 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -29,6 +29,7 @@ pages: - 'Test with Behat and Selenium': 'extras/behat.md' - Other Information: - 'Using Different Base OSes': 'other/base-os.md' + - 'Using Different Webservers': 'other/webservers.md' - 'PHP 7 on Drupal VM': 'other/php-7.md' - 'Networking Notes': 'other/networking.md' - 'Drupal 6 Notes': 'other/drupal-6.md' From fb4f88d3b387f8e209a969f14f6bcf6bab1e22cd Mon Sep 17 00:00:00 2001 From: Jeff Geerling Date: Mon, 21 Sep 2015 23:15:13 -0500 Subject: [PATCH 0050/1273] Fixes #89: Add possibility to use NGINX. --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 9c1bd62c1..bbd520e88 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ This project aims to make spinning up a simple local Drupal test/development env It will install the following on an Ubuntu 14.04 (by default) linux VM: - - Apache 2.4.x + - Apache 2.4.x (or Nginx 1.x) - PHP 5.5.x (configurable) - MySQL 5.5.x - Drush (configurable) @@ -77,7 +77,7 @@ Note: *If there are any errors during the course of running `vagrant up`, and it ### 3 - Configure your host machine to access the VM. 1. [Edit your hosts file](http://www.rackspace.com/knowledge_center/article/how-do-i-modify-my-hosts-file), adding the line `192.168.88.88 drupalvm.dev` so you can connect to the VM. - - You can have Vagrant automatically configure your hosts file if you install the `hostsupdater` plugin (`vagrant plugin install vagrant-hostsupdater`). All hosts defined in `apache_vhosts` will be automatically managed. + - You can have Vagrant automatically configure your hosts file if you install the `hostsupdater` plugin (`vagrant plugin install vagrant-hostsupdater`). All hosts defined in `apache_vhosts` or `nginx_hosts` will be automatically managed. - You can also have Vagrant automatically assign an available IP address to your VM if you install the `auto_network` plugin (`vagrant plugin install vagrant-auto_network`), and set `vagrant_ip` to `0.0.0.0` inside `config.yml`. 2. Open your browser and access [http://drupalvm.dev/](http://drupalvm.dev/). The default login for the admin account is `admin` for both the username and password. From 8e106073f431b881db43d319d1d8a131a28c9e00 Mon Sep 17 00:00:00 2001 From: Jeff Geerling Date: Tue, 22 Sep 2015 09:45:09 -0500 Subject: [PATCH 0051/1273] Fixes #251: Make Adminer config work better across webservers. --- example.config.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/example.config.yml b/example.config.yml index 82bf2a436..f8083f40c 100644 --- a/example.config.yml +++ b/example.config.yml @@ -79,6 +79,9 @@ apache_vhosts: - servername: "{{ drupal_domain }}" documentroot: "{{ drupal_core_path }}" + - servername: "adminer.drupalvm.dev" + documentroot: "/opt/adminer" + - servername: "xhprof.drupalvm.dev" documentroot: "/usr/share/php/xhprof_html" @@ -99,6 +102,10 @@ nginx_hosts: root: "{{ drupal_core_path }}" is_php: true + - server_name: "adminer.drupalvm.dev" + root: "/opt/adminer" + is_php: true + - server_name: "xhprof.drupalvm.dev" root: "/usr/share/php/xhprof_html" is_php: true @@ -190,7 +197,7 @@ mysql_root_password: root mysql_slow_query_log_enabled: true mysql_slow_query_time: 2 mysql_wait_timeout: 300 -adminer_add_apache_config: true +adminer_install_filename: index.php # Varnish Configuration. varnish_listen_port: "81" From abc41381b3c76ec331d621165f9144e05436b9d2 Mon Sep 17 00:00:00 2001 From: Jeff Geerling Date: Tue, 22 Sep 2015 09:47:20 -0500 Subject: [PATCH 0052/1273] Issue #251: Fix Adminer documentation. --- docs/extras/mysql.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/extras/mysql.md b/docs/extras/mysql.md index e3b985813..e5062bb54 100644 --- a/docs/extras/mysql.md +++ b/docs/extras/mysql.md @@ -2,7 +2,7 @@ By default, this VM is set up so you can manage MySQL databases on your own. The ## Connect using Adminer -If you have `adminer` listed as one of the `installed_extras` inside `config.yml`, you can use Adminer's web-based interface to interact with databases. With Drupal VM running, visit `http://drupalvm.dev/adminer/`, and log in with `root` as the username and the password you set in `config.yml` (`mysql_root_password`). Leave the "Server" field blank. The "Database" field is optional. +If you have `adminer` listed as one of the `installed_extras` inside `config.yml`, you can use Adminer's web-based interface to interact with databases. With Drupal VM running, visit `http://adminer.drupalvm.dev/`, and log in with `root` as the username and the password you set in `config.yml` (`mysql_root_password`). Leave the "Server" field blank. The "Database" field is optional. More about how to use Adminer: [Adminer website](http://www.adminer.org/). From de115e3a21488631d378ac73a56f04c43b36c4db Mon Sep 17 00:00:00 2001 From: Jeff Geerling Date: Tue, 22 Sep 2015 09:55:54 -0500 Subject: [PATCH 0053/1273] Fixes #227: Document Nodejs usage and Node/Ruby inclusion. --- README.md | 2 ++ docs/extras/nodejs.md | 20 ++++++++++++++++++++ mkdocs.yml | 1 + 3 files changed, 23 insertions(+) create mode 100644 docs/extras/nodejs.md diff --git a/README.md b/README.md index bbd520e88..232146370 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,9 @@ It will install the following on an Ubuntu 14.04 (by default) linux VM: - Optional: - Varnish 4.x - Apache Solr 4.10.x (configurable) + - Node.js - Selenium, for testing your sites via Behat + - Ruby - Memcached - XHProf, for profiling your code - XDebug, for debugging your code diff --git a/docs/extras/nodejs.md b/docs/extras/nodejs.md new file mode 100644 index 000000000..132b59cab --- /dev/null +++ b/docs/extras/nodejs.md @@ -0,0 +1,20 @@ +Node.js is used for many different purposes, but with Drupal, it is most often used as part of a toolset for Front End development or certain CI tasks. + +Drupal VM includes built-in support for Node.js—all you need to do is make sure `nodejs` is listed in the list of `installed_extras` inside `config.yml` before your provision Drupal VM. + +## Choosing a version of Node.js + +You can choose a version of Node.js to install using the `nodejs_version` variable in `config.yml`. See the `geerlingguy.nodejs` role documentation for all the currently-available versions for your OS. + +```yaml +nodejs_version: "0.12" +``` + +## Installing global packages via NPM + +To install packages globally, you can add them to the list of `nodejs_npm_global_packages` in `config.yml`. As an example, many developers use `phantomjs` as a ghost web driver for Behat tests inside Drupal VM. To install it globally, add it to the list: + +```yaml +nodejs_npm_global_packages: + - name: phantomjs +``` diff --git a/mkdocs.yml b/mkdocs.yml index 62b9a8aca..5c29f2c6a 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -22,6 +22,7 @@ pages: - 'Use Drupal Console with Drupal VM': 'extras/drupal-console.md' - 'Use Varnish with Drupal VM': 'extras/varnish.md' - 'Use MariaDB instead of MySQL': 'extras/mariadb.md' + - 'Use Node.js and NPM': 'extras/nodejs.md' - 'View Logs with Pimp my Log': 'extras/pimpmylog.md' - 'Profile Code with XHProf': 'extras/xhprof.md' - 'Debug Code with XDebug': 'extras/xdebug.md' From 78f4fe734f8be747a0d9bfd8c6e499e8adb49368 Mon Sep 17 00:00:00 2001 From: Jeff Geerling Date: Tue, 22 Sep 2015 21:18:38 -0500 Subject: [PATCH 0054/1273] Fixes #235: Improve Git permissions guidance for Windows users. --- README.md | 1 - docs/other/windows.md | 13 +++++++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index ab09ddfe7..232146370 100644 --- a/README.md +++ b/README.md @@ -62,7 +62,6 @@ Note for Linux users: *If NFS is not already installed on your host, you will ne Note on versions: *Please make sure you're running the latest stable version of Vagrant, VirtualBox, and Ansible, as the current version of Drupal VM is tested with the latest releases. As of August 2015: Vagrant 1.7.4, VirtualBox 5.0.2, and Ansible 1.9.2.* - ### 2 - Build the Virtual Machine 1. Download this project and put it wherever you want. diff --git a/docs/other/windows.md b/docs/other/windows.md index b74c688cc..df981706c 100644 --- a/docs/other/windows.md +++ b/docs/other/windows.md @@ -13,9 +13,13 @@ There are two parts to this: 1. VirtualBox does not allow gets VMs to create symlinks in synced folders by default. 2. Windows does not allow the creation of symlinks unless your local policy allows it; see [TechNet article](https://technet.microsoft.com/en-us/library/dn221947%28v=ws.10%29.aspx). Even if local policy allows it, many users experience problems in the creation of symlinks. -### GIT & Permissions +### Git and File permissions -Do not work with git inside the synced folder inside the VM. Always use git on the Windows side. Otherwise the difference in permissions systems will make git think all your files have always been modified. It will also set the wrong permissions on any file you commit from inside the VM. +If you're using a synced folder for your project, you should choose to either work _only_ inside the VM, or _only_ on the host machine. Don't commit changes both inside the VM and on the host unless you know what you're doing and have Git configured properly for Unix vs. Windows line endings. File permissions and line endings can be changed in ways that can break your project if you're not careful! + +You should probably disable Git's `fileMode` option inside the VM and on your host machine if you're running Windows and making changes to a Git repository: + + git config core.fileMode false ### Long Paths @@ -33,5 +37,6 @@ Some Windows users have reported running into an issue where an authentication f 2. Run `vagrant ssh-config` 3. Restart the VM with `vagrant reload` -### Required PowerShell Version -If you are running Windows 7 and vagrant up hangs, you may need to upgrade PowerShell. Windows 7 ships with PowerShell 2.0, but PowerShell 3.0 or higher is needed. For Windows 7, you can upgrade to PowerShell 4.0 which is part of the [Windows Management Framework](http://www.microsoft.com/en-us/download/details.aspx?id=40855). +### Windows 7 requires PowerShell upgrade + +If you are running Windows 7 and `vagrant up` hangs, you may need to upgrade PowerShell. Windows 7 ships with PowerShell 2.0, but PowerShell 3.0 or higher is required. For Windows 7, you can upgrade to PowerShell 4.0 which is part of the [Windows Management Framework](http://www.microsoft.com/en-us/download/details.aspx?id=40855). From 0d9deeed305959fa2b8480fe7aab23b33503315d Mon Sep 17 00:00:00 2001 From: Thom Toogood Date: Wed, 23 Sep 2015 15:11:11 +0200 Subject: [PATCH 0055/1273] Updated requirements to use YAML. --- .travis.yml | 2 +- README.md | 2 +- provisioning/requirements.txt | 28 ---------------------------- provisioning/requirements.yml | 29 +++++++++++++++++++++++++++++ 4 files changed, 31 insertions(+), 30 deletions(-) delete mode 100644 provisioning/requirements.txt create mode 100644 provisioning/requirements.yml diff --git a/.travis.yml b/.travis.yml index e14aae626..08ff1da89 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,7 +15,7 @@ script: - cp example.drupal.make.yml drupal.make.yml # Make sure Ansible requirements install correctly. - - 'ansible-galaxy install -r provisioning/requirements.txt' + - 'ansible-galaxy install -r provisioning/requirements.yml' # Run Ansible's syntax and playbook check on the main playbook. - 'ansible-playbook -i "localhost," -c local provisioning/playbook.yml --syntax-check' diff --git a/README.md b/README.md index 9c1bd62c1..148555345 100644 --- a/README.md +++ b/README.md @@ -70,7 +70,7 @@ Note on versions: *Please make sure you're running the latest stable version of 4. Open Terminal, cd to this directory (containing the `Vagrantfile` and this README file). 5. Type in `vagrant up`, and let Vagrant do its magic. -If you have Ansible installed on your host machine: Run `$ sudo ansible-galaxy install -r provisioning/requirements.txt --force` prior to step 5 (`vagrant up`), otherwise Ansible will complain about missing roles. +If you have Ansible installed on your host machine: Run `$ sudo ansible-galaxy install -r provisioning/requirements.yml --force` prior to step 5 (`vagrant up`), otherwise Ansible will complain about missing roles. Note: *If there are any errors during the course of running `vagrant up`, and it drops you back to your command prompt, just run `vagrant provision` to continue building the VM from where you left off. If there are still errors after doing this a few times, post an issue to this project's issue queue on GitHub with the error.* diff --git a/provisioning/requirements.txt b/provisioning/requirements.txt deleted file mode 100644 index 17b866e16..000000000 --- a/provisioning/requirements.txt +++ /dev/null @@ -1,28 +0,0 @@ -arknoll.selenium -geerlingguy.adminer -geerlingguy.apache -geerlingguy.composer -geerlingguy.daemonize -geerlingguy.drupal-console -geerlingguy.drush -geerlingguy.firewall -geerlingguy.git -geerlingguy.java -geerlingguy.mailhog -geerlingguy.memcached -geerlingguy.mysql -geerlingguy.nginx -geerlingguy.nodejs -geerlingguy.php -geerlingguy.php-memcached -geerlingguy.php-mysql -geerlingguy.php-pecl -geerlingguy.php-xdebug -geerlingguy.php-xhprof -geerlingguy.pimpmylog -geerlingguy.postfix -geerlingguy.repo-remi -geerlingguy.ruby -geerlingguy.security -geerlingguy.solr -geerlingguy.varnish diff --git a/provisioning/requirements.yml b/provisioning/requirements.yml new file mode 100644 index 000000000..cddb54586 --- /dev/null +++ b/provisioning/requirements.yml @@ -0,0 +1,29 @@ +--- +- src: arknoll.selenium +- src: geerlingguy.adminer +- src: geerlingguy.apache +- src: geerlingguy.composer +- src: geerlingguy.daemonize +- src: geerlingguy.drupal-console +- src: geerlingguy.drush +- src: geerlingguy.firewall +- src: geerlingguy.git +- src: geerlingguy.java +- src: geerlingguy.mailhog +- src: geerlingguy.memcached +- src: geerlingguy.mysql +- src: geerlingguy.nginx +- src: geerlingguy.nodejs +- src: geerlingguy.php +- src: geerlingguy.php-memcached +- src: geerlingguy.php-mysql +- src: geerlingguy.php-pecl +- src: geerlingguy.php-xdebug +- src: geerlingguy.php-xhprof +- src: geerlingguy.pimpmylog +- src: geerlingguy.postfix +- src: geerlingguy.repo-remi +- src: geerlingguy.ruby +- src: geerlingguy.security +- src: geerlingguy.solr +- src: geerlingguy.varnish \ No newline at end of file From 9a54c12680ec47d100173aa5497f31a8bd7edde2 Mon Sep 17 00:00:00 2001 From: Jeff Geerling Date: Wed, 23 Sep 2015 09:13:20 -0500 Subject: [PATCH 0056/1273] PR #248 Cleanup: Add extra newline at EOF. --- provisioning/requirements.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/provisioning/requirements.yml b/provisioning/requirements.yml index cddb54586..1542a8a29 100644 --- a/provisioning/requirements.yml +++ b/provisioning/requirements.yml @@ -26,4 +26,4 @@ - src: geerlingguy.ruby - src: geerlingguy.security - src: geerlingguy.solr -- src: geerlingguy.varnish \ No newline at end of file +- src: geerlingguy.varnish From 86d86e72f73c0587b9ff956a983ea80578c13067 Mon Sep 17 00:00:00 2001 From: Rafal B Date: Mon, 7 Sep 2015 15:02:15 +0100 Subject: [PATCH 0057/1273] Added ansible task which copies known_hosts file from host to guest --- Vagrantfile | 3 +++ example.config.yml | 4 ++++ provisioning/tasks/sshd.yml | 15 +++++++++++++++ 3 files changed, 22 insertions(+) diff --git a/Vagrantfile b/Vagrantfile index 4ca0a106d..0d6e82d40 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -61,6 +61,9 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| config.vm.provision "ansible" do |ansible| ansible.playbook = "#{dir}/provisioning/playbook.yml" ansible.sudo = true + ansible.extra_vars = { + known_hosts_path: vconfig['known_hosts_path'] + } end # Provision using shell provisioner and JJG-Ansible-Windows otherwise. else diff --git a/example.config.yml b/example.config.yml index da1925dfa..52a33f3d6 100644 --- a/example.config.yml +++ b/example.config.yml @@ -22,6 +22,10 @@ vagrant_synced_folders: type: nfs create: true +# Source location of known_hosts file on your machine. +# The location might be different on Windows, change it if you need. +known_hosts_path: ~/.ssh/known_hosts + # Memory and CPU to use for this VM. vagrant_memory: 1024 vagrant_cpus: 2 diff --git a/provisioning/tasks/sshd.yml b/provisioning/tasks/sshd.yml index 262430b0c..53e8eddf3 100644 --- a/provisioning/tasks/sshd.yml +++ b/provisioning/tasks/sshd.yml @@ -5,3 +5,18 @@ regexp: "^AcceptEnv LANG" state: absent validate: "/usr/sbin/sshd -T -f %s" + +# Copy over known_hosts. +- name: Check if known_hosts file is present. + stat: "path={{ known_hosts_path }}" + register: known_hosts + connection: local + sudo: no + +- name: Copy known_hosts file from host into Drupal VM. + copy: + src: "{{ known_hosts_path }}" + dest: ~/.ssh/known_hosts + mode: 0644 + sudo: no + when: known_hosts.stat.exists From 83a88d2c68d263b6e1f8d996c35a4aec922ab625 Mon Sep 17 00:00:00 2001 From: Jeff Geerling Date: Mon, 28 Sep 2015 21:21:53 -0500 Subject: [PATCH 0058/1273] Revert "Pass the port number from the Vagrant autogenerated inventory" --- provisioning/templates/drupalvm.aliases.drushrc.php.j2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/provisioning/templates/drupalvm.aliases.drushrc.php.j2 b/provisioning/templates/drupalvm.aliases.drushrc.php.j2 index eab5d77af..9f1138518 100644 --- a/provisioning/templates/drupalvm.aliases.drushrc.php.j2 +++ b/provisioning/templates/drupalvm.aliases.drushrc.php.j2 @@ -12,7 +12,7 @@ $aliases['{{ vhost.servername }}'] = array( 'root' => '{{ vhost.documentroot }}', 'remote-host' => '{{ vhost.servername }}', 'remote-user' => 'vagrant', - 'ssh-options' => '-p {{ ansible_ssh_port }} -o PasswordAuthentication=no -i ~/.vagrant.d/insecure_private_key', + 'ssh-options' => '-o PasswordAuthentication=no -i ~/.vagrant.d/insecure_private_key', ); {% endfor %} From c459e3dde68d468beab725fa6773a16a2a852595 Mon Sep 17 00:00:00 2001 From: Jeff Geerling Date: Sat, 3 Oct 2015 21:39:55 -0500 Subject: [PATCH 0059/1273] Security fix per https://www.drupal.org/node/2508591. --- provisioning/templates/nginx-vhost.conf.j2 | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/provisioning/templates/nginx-vhost.conf.j2 b/provisioning/templates/nginx-vhost.conf.j2 index ef1d24685..683607d72 100644 --- a/provisioning/templates/nginx-vhost.conf.j2 +++ b/provisioning/templates/nginx-vhost.conf.j2 @@ -20,6 +20,12 @@ server { try_files $uri @rewrite; } + # Don't allow direct access to the vendor directory. + location ~ /vendor { + deny all; + return 404; + } + # Use fastcgi for all php files. location ~ \.php$ { # Secure *.php files. From 1ee6cae49c74b3b502c7294630d13e29e560190e Mon Sep 17 00:00:00 2001 From: Jeff Geerling Date: Sat, 3 Oct 2015 22:10:57 -0500 Subject: [PATCH 0060/1273] Update config for security of vendor directory. --- provisioning/templates/nginx-vhost.conf.j2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/provisioning/templates/nginx-vhost.conf.j2 b/provisioning/templates/nginx-vhost.conf.j2 index 683607d72..6440d073b 100644 --- a/provisioning/templates/nginx-vhost.conf.j2 +++ b/provisioning/templates/nginx-vhost.conf.j2 @@ -21,7 +21,7 @@ server { } # Don't allow direct access to the vendor directory. - location ~ /vendor { + location ~ /vendor/.*\.php$ { deny all; return 404; } From 02d7264bbc49aeffa577a46eac76a0b69a7d67b0 Mon Sep 17 00:00:00 2001 From: Jeff Geerling Date: Sat, 3 Oct 2015 22:18:44 -0500 Subject: [PATCH 0061/1273] Update description of security directive in nginx config. --- provisioning/templates/nginx-vhost.conf.j2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/provisioning/templates/nginx-vhost.conf.j2 b/provisioning/templates/nginx-vhost.conf.j2 index 6440d073b..7810ac3de 100644 --- a/provisioning/templates/nginx-vhost.conf.j2 +++ b/provisioning/templates/nginx-vhost.conf.j2 @@ -20,7 +20,7 @@ server { try_files $uri @rewrite; } - # Don't allow direct access to the vendor directory. + # Don't allow direct access to PHP files in the vendor directory. location ~ /vendor/.*\.php$ { deny all; return 404; From 9a7f5bfe1b915d83c08d7b3c49036159e8862c86 Mon Sep 17 00:00:00 2001 From: Jeff Geerling Date: Wed, 7 Oct 2015 07:18:52 -0400 Subject: [PATCH 0062/1273] Updated README.md. --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 85a7ce82a..1d31d6054 100644 --- a/README.md +++ b/README.md @@ -9,15 +9,15 @@ This project aims to make spinning up a simple local Drupal test/development env It will install the following on an Ubuntu 14.04 (by default) linux VM: - Apache 2.4.x (or Nginx 1.x) - - PHP 5.5.x (configurable) + - PHP 5.6.x (configurable) - MySQL 5.5.x - Drush (configurable) - Drupal Console (if using Drupal 8+) - Drupal 6.x, 7.x, or 8.x.x (configurable) - Optional: - - Varnish 4.x + - Varnish 4.x (configurable) - Apache Solr 4.10.x (configurable) - - Node.js + - Node.js 0.12 (configurable) - Selenium, for testing your sites via Behat - Ruby - Memcached From f787d1f2a51616cac3702895efe408a02f3ad3ce Mon Sep 17 00:00:00 2001 From: Jeff Geerling Date: Wed, 7 Oct 2015 13:35:07 -0400 Subject: [PATCH 0063/1273] Cleanup for PR #234. --- Vagrantfile | 3 --- example.config.yml | 9 ++++----- provisioning/tasks/sshd.yml | 11 +++++------ 3 files changed, 9 insertions(+), 14 deletions(-) diff --git a/Vagrantfile b/Vagrantfile index 97e9c15d8..7409b5976 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -76,9 +76,6 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| config.vm.provision "ansible" do |ansible| ansible.playbook = "#{dir}/provisioning/playbook.yml" ansible.sudo = true - ansible.extra_vars = { - known_hosts_path: vconfig['known_hosts_path'] - } end # Provision using shell provisioner and JJG-Ansible-Windows otherwise. else diff --git a/example.config.yml b/example.config.yml index daa6724fd..1622df80a 100644 --- a/example.config.yml +++ b/example.config.yml @@ -26,10 +26,6 @@ vagrant_synced_folders: type: nfs create: true -# Source location of known_hosts file on your machine. -# The location might be different on Windows, change it if you need. -known_hosts_path: ~/.ssh/known_hosts - # Memory and CPU to use for this VM. vagrant_memory: 1024 vagrant_cpus: 2 @@ -228,5 +224,8 @@ solr_version: "4.10.4" solr_xms: "64M" solr_xmx: "128M" -# Selenium configuration +# Selenium configuration. selenium_version: 2.46.0 + +# Other configuration. +known_hosts_path: ~/.ssh/known_hosts diff --git a/provisioning/tasks/sshd.yml b/provisioning/tasks/sshd.yml index 53e8eddf3..1d8f4c5e3 100644 --- a/provisioning/tasks/sshd.yml +++ b/provisioning/tasks/sshd.yml @@ -6,17 +6,16 @@ state: absent validate: "/usr/sbin/sshd -T -f %s" -# Copy over known_hosts. -- name: Check if known_hosts file is present. - stat: "path={{ known_hosts_path }}" - register: known_hosts +- name: Check if local known_hosts file is present. + stat: "path={{ known_hosts_path | default('~/.ssh/known_hosts') }}" + register: known_hosts_file connection: local sudo: no - name: Copy known_hosts file from host into Drupal VM. copy: - src: "{{ known_hosts_path }}" + src: "{{ known_hosts_path | default('~/.ssh/known_hosts') }}" dest: ~/.ssh/known_hosts mode: 0644 sudo: no - when: known_hosts.stat.exists + when: known_hosts_file.stat.exists From a0070b034aa561e153f006b86fd0f48f6036c247 Mon Sep 17 00:00:00 2001 From: Alexander Ross Date: Thu, 15 Oct 2015 12:15:41 -0400 Subject: [PATCH 0064/1273] Minor grammatical errors --- docs/extras/mysql.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/extras/mysql.md b/docs/extras/mysql.md index e5062bb54..4a18ed96b 100644 --- a/docs/extras/mysql.md +++ b/docs/extras/mysql.md @@ -1,4 +1,4 @@ -By default, this VM is set up so you can manage MySQL databases on your own. The default root MySQL user credentials are `root` for username and password, but you can change the password via `config.yml` (changing the `mysql_root_password` variable). I use the [Sequel Pro](http://www.sequelpro.com/) (Mac-only) to connect and manage databases, and Drush to sync databases (sometimes I'll just do a dump and import, but Drush is usually quicker, and is easier to do over and over again when you need it). +By default, this VM is set up so you can manage MySQL databases on your own. The default root MySQL user credentials are `root` for username and password, but you can change the password via `config.yml` (changing the `mysql_root_password` variable). I use [Sequel Pro](http://www.sequelpro.com/) (Mac-only) to connect to and manage databases, and Drush to sync databases (sometimes I'll just do a dump and import, but Drush is usually quicker, and is easier to do over and over again when you need it). ## Connect using Adminer From e4dcdee5efc4d4e944e80f8936957fc289c170bf Mon Sep 17 00:00:00 2001 From: Scott Reese Date: Mon, 19 Oct 2015 14:24:36 -0700 Subject: [PATCH 0065/1273] Updates to examples and syntax highlighting. * Updated behat.yml to include the needed contexts to load and use the DrupalExtension driver. * Updated examples to point to features/web since that is what behat.yml is set up for. * Added syntax to code fences to help fix formatting on the web page. --- docs/extras/behat.md | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/docs/extras/behat.md b/docs/extras/behat.md index 246dcb471..6ad471e7e 100644 --- a/docs/extras/behat.md +++ b/docs/extras/behat.md @@ -34,12 +34,17 @@ Using the default Drupal site as an example (it's installed in `/var/www/drupal` 1. Create a `behat.yml` file inside the docroot of your site (e.g. create this file alongside the rest of the Drupal codebase at `/var/www/drupal/behat.yml`), with the following contents: - ``` + ```yaml default: suites: web_features: paths: [ %paths.base%/features/web ] - contexts: [ WebContext ] + contexts: + - WebContext + - Drupal\DrupalExtension\Context\DrupalContext + - Drupal\DrupalExtension\Context\MinkContext + - Drupal\DrupalExtension\Context\MessageContext + - Drupal\DrupalExtension\Context\DrushContext extensions: Behat\MinkExtension: goutte: ~ @@ -52,12 +57,14 @@ Using the default Drupal site as an example (it's installed in `/var/www/drupal` api_driver: 'drupal' drupal: drupal_root: '/var/www/drupal' + region_map: + content: "#content" ``` 2. Log into Drupal VM with `vagrant ssh`, change directory to the Drupal site root (`cd /var/www/drupal`), then run `behat --init` to initialize the `features` folder where you will place test cases. - 3. From either inside the VM or on the host machine, open up the new `features` folder Behat just created, and create a new `drupal` folder inside. Inside _that_ folder, create `HomeContent.feature` with the following contents: + 3. From either inside the VM or on the host machine, open up the new `features/web` folder Behat just created. Inside _that_ folder, create `HomeContent.feature` with the following contents: - ``` + ```gherkin Feature: Test DrupalContext In order to prove the Behat is working correctly in Drupal VM As a developer @@ -73,7 +80,7 @@ Using the default Drupal site as an example (it's installed in `/var/www/drupal` If everything was done correctly, you should see: -``` +```console $ behat Feature: Test DrupalContext In order to prove the Behat is working correctly in Drupal VM @@ -92,4 +99,4 @@ Feature: Test DrupalContext Hooray! Now you're ready to get started testing ALL THE THINGS! Check out the following resources for more information about Behat and Drupal: - [Behat 3.0 Documentation](http://behat.readthedocs.org/en/v3.0/) - - [Drupal Extension Documentation](https://behat-drupal-extension.readthedocs.org/en/3.0/) \ No newline at end of file + - [Drupal Extension Documentation](https://behat-drupal-extension.readthedocs.org/en/3.0/) From e7e775cfba20e3f9fcff557e2f781f22c244d8e0 Mon Sep 17 00:00:00 2001 From: Jeff Geerling Date: Mon, 19 Oct 2015 16:52:54 -0500 Subject: [PATCH 0066/1273] gs --- docs/extras/behat.md | 54 ++++++++++++++++++++++---------------------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/docs/extras/behat.md b/docs/extras/behat.md index 6ad471e7e..c153e8b8d 100644 --- a/docs/extras/behat.md +++ b/docs/extras/behat.md @@ -34,33 +34,33 @@ Using the default Drupal site as an example (it's installed in `/var/www/drupal` 1. Create a `behat.yml` file inside the docroot of your site (e.g. create this file alongside the rest of the Drupal codebase at `/var/www/drupal/behat.yml`), with the following contents: - ```yaml - default: - suites: - web_features: - paths: [ %paths.base%/features/web ] - contexts: - - WebContext - - Drupal\DrupalExtension\Context\DrupalContext - - Drupal\DrupalExtension\Context\MinkContext - - Drupal\DrupalExtension\Context\MessageContext - - Drupal\DrupalExtension\Context\DrushContext - extensions: - Behat\MinkExtension: - goutte: ~ - javascript_session: selenium2 - selenium2: - wd_host: http://drupalvm.dev:4444/wd/hub - base_url: http://drupalvm.dev - Drupal\DrupalExtension: - blackbox: ~ - api_driver: 'drupal' - drupal: - drupal_root: '/var/www/drupal' - region_map: - content: "#content" - ``` - + ```yaml + default: + suites: + web_features: + paths: [ %paths.base%/features/web ] + contexts: + - WebContext + - Drupal\DrupalExtension\Context\DrupalContext + - Drupal\DrupalExtension\Context\MinkContext + - Drupal\DrupalExtension\Context\MessageContext + - Drupal\DrupalExtension\Context\DrushContext + extensions: + Behat\MinkExtension: + goutte: ~ + javascript_session: selenium2 + selenium2: + wd_host: http://drupalvm.dev:4444/wd/hub + base_url: http://drupalvm.dev + Drupal\DrupalExtension: + blackbox: ~ + api_driver: 'drupal' + drupal: + drupal_root: '/var/www/drupal' + region_map: + content: "#content" + ``` + 2. Log into Drupal VM with `vagrant ssh`, change directory to the Drupal site root (`cd /var/www/drupal`), then run `behat --init` to initialize the `features` folder where you will place test cases. 3. From either inside the VM or on the host machine, open up the new `features/web` folder Behat just created. Inside _that_ folder, create `HomeContent.feature` with the following contents: From 4bdad302f59f72f564df4eb4474a66697ed7272d Mon Sep 17 00:00:00 2001 From: Jeff Geerling Date: Mon, 19 Oct 2015 16:54:14 -0500 Subject: [PATCH 0067/1273] Better formatting of Behat example. --- docs/extras/behat.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/docs/extras/behat.md b/docs/extras/behat.md index c153e8b8d..81d37d145 100644 --- a/docs/extras/behat.md +++ b/docs/extras/behat.md @@ -34,7 +34,6 @@ Using the default Drupal site as an example (it's installed in `/var/www/drupal` 1. Create a `behat.yml` file inside the docroot of your site (e.g. create this file alongside the rest of the Drupal codebase at `/var/www/drupal/behat.yml`), with the following contents: - ```yaml default: suites: web_features: @@ -59,7 +58,6 @@ Using the default Drupal site as an example (it's installed in `/var/www/drupal` drupal_root: '/var/www/drupal' region_map: content: "#content" - ``` 2. Log into Drupal VM with `vagrant ssh`, change directory to the Drupal site root (`cd /var/www/drupal`), then run `behat --init` to initialize the `features` folder where you will place test cases. 3. From either inside the VM or on the host machine, open up the new `features/web` folder Behat just created. Inside _that_ folder, create `HomeContent.feature` with the following contents: From 1ea6c51cdb1d2304cfe947300ac53e23c8343af7 Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Tue, 20 Oct 2015 17:16:42 +0100 Subject: [PATCH 0068/1273] Add documentation and example of rsync excluded_paths --- docs/extras/syncing-folders.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/docs/extras/syncing-folders.md b/docs/extras/syncing-folders.md index 65288e9a7..258bca15b 100644 --- a/docs/extras/syncing-folders.md +++ b/docs/extras/syncing-folders.md @@ -26,6 +26,23 @@ Generally speaking: - Rsync offers the best performance inside the VM, but sync is currently one-way-only (from host to VM), which can make certain development workflows burdensome - Native shared folders offer abysmal performance; only use this mechanism as a last resort! +If you are using rsync, it is advised to exclude certain directories so that they aren't synced. These include version control directories, database exports and Drupal's files directory. + +```yaml +vagrant_synced_folders: + - local_path: ~/Sites/drupalvm/drupal + destination: /var/www + id: drupal + type: rsync + excluded_paths: + - drupal/private + - drupal/public/.git + - drupal/public/sites/default/files + - drupal/tmp +``` + +This example assumes that you have Drupal in a directory called `drupal/public`. + ## Synced Folder Troubleshooting There are a number of issues people encounter with synced folders from time to time. The most frequent issues are listed below with possible solutions: From 2152f645186b22277add0a7e99e892a5c0a79203 Mon Sep 17 00:00:00 2001 From: Jeff Geerling Date: Fri, 30 Oct 2015 13:23:44 -0500 Subject: [PATCH 0069/1273] Fixes #280: Code blocks in Behat docs are formatted incorrectly. --- docs/extras/behat.md | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/docs/extras/behat.md b/docs/extras/behat.md index 81d37d145..257ef5beb 100644 --- a/docs/extras/behat.md +++ b/docs/extras/behat.md @@ -62,18 +62,15 @@ Using the default Drupal site as an example (it's installed in `/var/www/drupal` 2. Log into Drupal VM with `vagrant ssh`, change directory to the Drupal site root (`cd /var/www/drupal`), then run `behat --init` to initialize the `features` folder where you will place test cases. 3. From either inside the VM or on the host machine, open up the new `features/web` folder Behat just created. Inside _that_ folder, create `HomeContent.feature` with the following contents: - ```gherkin - Feature: Test DrupalContext - In order to prove the Behat is working correctly in Drupal VM - As a developer - I need to run a simple interface test - - Scenario: Viewing content in a region - Given I am on the homepage - Then I should see "No front page content has been created yet" in the "content" - - ``` - + Feature: Test DrupalContext + In order to prove the Behat is working correctly in Drupal VM + As a developer + I need to run a simple interface test + + Scenario: Viewing content in a region + Given I am on the homepage + Then I should see "No front page content has been created yet" in the "content" + 4. Now, inside Drupal VM, change directory to `/var/www/drupal` again, and run the command `behat` (which runs all the tests you've created—which should just be one so far). If everything was done correctly, you should see: From de87433762186488c5e7abd31468ef10b92ce3af Mon Sep 17 00:00:00 2001 From: Jeff Geerling Date: Sat, 31 Oct 2015 21:10:09 -0500 Subject: [PATCH 0070/1273] Fixes #290: For Windows, VT-x is disabled in the bios for both all cpu modes. --- docs/other/windows.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/other/windows.md b/docs/other/windows.md index df981706c..7a7c01ece 100644 --- a/docs/other/windows.md +++ b/docs/other/windows.md @@ -40,3 +40,7 @@ Some Windows users have reported running into an issue where an authentication f ### Windows 7 requires PowerShell upgrade If you are running Windows 7 and `vagrant up` hangs, you may need to upgrade PowerShell. Windows 7 ships with PowerShell 2.0, but PowerShell 3.0 or higher is required. For Windows 7, you can upgrade to PowerShell 4.0 which is part of the [Windows Management Framework](http://www.microsoft.com/en-us/download/details.aspx?id=40855). + +## Intel VT-x virtualization support + +On some laptops, Intel VT-x virtualization (which is built into most modern Intel processors) is enabled by default. This allows VirtualBox to run virtual machines efficiently using the CPU itself instead of software CPU emulation. If you get a message like "VT-x is disabled in the bios for both all cpu modes" or something similar, you may need to enter your computer's BIOS settings and enable this virtualization support. From 89aee26c26d75fa4c29cf5b4a75cc437588dae1e Mon Sep 17 00:00:00 2001 From: Jeff Geerling Date: Sat, 31 Oct 2015 22:52:12 -0500 Subject: [PATCH 0071/1273] Fixes #291: Add instructions for Windows and hostsupdater usage. --- docs/other/windows.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/docs/other/windows.md b/docs/other/windows.md index 7a7c01ece..2cad541fc 100644 --- a/docs/other/windows.md +++ b/docs/other/windows.md @@ -41,6 +41,13 @@ Some Windows users have reported running into an issue where an authentication f If you are running Windows 7 and `vagrant up` hangs, you may need to upgrade PowerShell. Windows 7 ships with PowerShell 2.0, but PowerShell 3.0 or higher is required. For Windows 7, you can upgrade to PowerShell 4.0 which is part of the [Windows Management Framework](http://www.microsoft.com/en-us/download/details.aspx?id=40855). +## Hosts file updates + +If you install the `vagrant-hostsupdater` plugin, you might get a permissions error when Vagrant tries changing the hosts file. On a Mac or Linux workstation, you're prompted for a sudo password so the change can be made, but on Windows, you have to do one of the following to make sure hostsupdater works correctly: + + 1. Run PowerShell or whatever CLI you use with Vagrant as an administrator. Right click on the application and select 'Run as administrator', then proceed with `vagrant` commands as normal. + 2. Change the permissions on the hosts file so anyone can edit the file (this has security implications, so it's best to use option 1 unless you know what you're doing). + ## Intel VT-x virtualization support On some laptops, Intel VT-x virtualization (which is built into most modern Intel processors) is enabled by default. This allows VirtualBox to run virtual machines efficiently using the CPU itself instead of software CPU emulation. If you get a message like "VT-x is disabled in the bios for both all cpu modes" or something similar, you may need to enter your computer's BIOS settings and enable this virtualization support. From 00f373ecc5693a62afa9dbf1ae14a9f37ab5f0a1 Mon Sep 17 00:00:00 2001 From: Jeff Geerling Date: Mon, 2 Nov 2015 22:36:36 -0600 Subject: [PATCH 0072/1273] Issue #297: Add notes about Windows performance improvements. --- docs/other/windows.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/docs/other/windows.md b/docs/other/windows.md index 2cad541fc..25d2dc446 100644 --- a/docs/other/windows.md +++ b/docs/other/windows.md @@ -4,6 +4,14 @@ There are a few caveats when using Drupal VM on Windows, and this page will try Most issues have to do synced folders. These are the most common ones: +### Performance + +By default, if you use the 'NFS' synced folder type, Vagrant will ignore this directive and use the native (usually slow) VirtualBox shared folder system instead. You can get higher performance by doing one of the following (all of these steps require a full VM reload (`vagrant reload`) to take effect): + + 1. **Install the `vagrant-winnfsd` plugin**. See the 'NFS' section later for more details and caveats. + 2. **Use `smb` for the synced folder's type.** + 2. **Use `rsync` for the synced folder's type.** This requires that you have `rsync` available on your Windows workstation, which you can get if you install a substitute CLI like [Cygwin](https://www.cygwin.com/). + ### Symbolic Links Creating symbolic links in a shared folder will fail with a permission or protocol error. From d0279e4d45d9db74c859293d3dba5d47b013e7d6 Mon Sep 17 00:00:00 2001 From: Jeff Geerling Date: Wed, 11 Nov 2015 13:32:03 -0600 Subject: [PATCH 0073/1273] Update Ansible for DevOps book links. --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 1d31d6054..c1f816ba8 100644 --- a/README.md +++ b/README.md @@ -125,7 +125,7 @@ Drupal VM is built to integrate with every developer's workflow. Many guides for - When you rebuild the VM (e.g. `vagrant destroy` and then another `vagrant up`), make sure you clear out the contents of the `drupal` folder on your host machine, or Drupal will return some errors when the VM is rebuilt (it won't reinstall Drupal cleanly). - You can change the installed version of Drupal or drush, or any other configuration options, by editing the variables within `config.yml`. - Find out more about local development with Vagrant + VirtualBox + Ansible in this presentation: [Local Development Environments - Vagrant, VirtualBox and Ansible](http://www.slideshare.net/geerlingguy/local-development-on-virtual-machines-vagrant-virtualbox-and-ansible). - - Learn about how Ansible can accelerate your ability to innovate and manage your infrastructure by reading [Ansible for DevOps](https://leanpub.com/ansible-for-devops). + - Learn about how Ansible can accelerate your ability to innovate and manage your infrastructure by reading [Ansible for DevOps](http://www.ansiblefordevops.com/). ## License @@ -133,4 +133,4 @@ This project is licensed under the MIT open source license. ## About the Author -[Jeff Geerling](http://jeffgeerling.com/), owner of [Midwestern Mac, LLC](http://www.midwesternmac.com/), created this project in 2014 so he could accelerate his Drupal core and contrib development workflow. This project, and others like it, are also featured as examples in Jeff's book, [Ansible for DevOps](https://leanpub.com/ansible-for-devops). +[Jeff Geerling](http://jeffgeerling.com/), owner of [Midwestern Mac, LLC](http://www.midwesternmac.com/), created this project in 2014 so he could accelerate his Drupal core and contrib development workflow. This project, and others like it, are also featured as examples in Jeff's book, [Ansible for DevOps](http://www.ansiblefordevops.com/). From e4ee925186449414612c8cc1d90cada8863f40de Mon Sep 17 00:00:00 2001 From: Jeff Geerling Date: Wed, 11 Nov 2015 14:06:49 -0600 Subject: [PATCH 0074/1273] Fixes #247: Ensure Apache is installed task fails due to permissions on /var/www. --- example.config.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/example.config.yml b/example.config.yml index 1622df80a..bfeb4a2be 100644 --- a/example.config.yml +++ b/example.config.yml @@ -22,7 +22,7 @@ vagrant_synced_folders: # The first synced folder will be used for the default Drupal installation, if # build_makefile: is 'true'. - local_path: ~/Sites/drupalvm - destination: /var/www + destination: /var/www/drupalvm type: nfs create: true @@ -45,7 +45,7 @@ install_site: true # Settings for building a Drupal site from a makefile (if 'build_makefile:' # is 'true'). drupal_major_version: 8 -drupal_core_path: "/var/www/drupal" +drupal_core_path: "/var/www/drupalvm/drupal" drupal_domain: "drupalvm.dev" drupal_site_name: "Drupal" drupal_install_profile: standard From 8c6544ecfe5ea93a538444c2a7c6354a08cc8057 Mon Sep 17 00:00:00 2001 From: Jeff Geerling Date: Wed, 11 Nov 2015 15:20:10 -0600 Subject: [PATCH 0075/1273] Updated README to add Ansible role installation to Quick Start Guide with a note. --- README.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index c1f816ba8..799eb8471 100644 --- a/README.md +++ b/README.md @@ -70,9 +70,8 @@ Note on versions: *Please make sure you're running the latest stable version of - Copy `example.config.yml` to `config.yml`. 3. Create a local directory where Drupal will be installed and configure the path to that directory in `config.yml` (`local_path`, inside `vagrant_synced_folders`). 4. Open Terminal, cd to this directory (containing the `Vagrantfile` and this README file). - 5. Type in `vagrant up`, and let Vagrant do its magic. - -If you have Ansible installed on your host machine: Run `$ sudo ansible-galaxy install -r provisioning/requirements.yml --force` prior to step 5 (`vagrant up`), otherwise Ansible will complain about missing roles. + 5. (If you have Ansible installed on Mac/Linux) Run `$ sudo ansible-galaxy install -r provisioning/requirements.yml --force`. + 6. Type in `vagrant up`, and let Vagrant do its magic. Note: *If there are any errors during the course of running `vagrant up`, and it drops you back to your command prompt, just run `vagrant provision` to continue building the VM from where you left off. If there are still errors after doing this a few times, post an issue to this project's issue queue on GitHub with the error.* From d127436a913583a95015c349315366fe2912a1d1 Mon Sep 17 00:00:00 2001 From: Jeff Geerling Date: Wed, 11 Nov 2015 15:58:38 -0600 Subject: [PATCH 0076/1273] Fixes #301 and Fixes #245: Document common Linux gotchas and tips. --- docs/other/linux.md | 67 +++++++++++++++++++++++++++++++++++++++++++++ mkdocs.yml | 1 + 2 files changed, 68 insertions(+) create mode 100644 docs/other/linux.md diff --git a/docs/other/linux.md b/docs/other/linux.md new file mode 100644 index 000000000..3d83c6c15 --- /dev/null +++ b/docs/other/linux.md @@ -0,0 +1,67 @@ +There are a few caveats when using Drupal VM on Linux, and this page will try to identify the main gotchas or optimization tips for those wishing to use Drupal VM on a Linux host. + +## Platform-specific Install Instructions + +### All Linux flavors + +Always make sure your workstation is up to date (e.g. `apt-get update && apt-get upgrade` on Debian-like systems, or `dnf upgrade` or `yum upgrade` on Fedora/RedHat-like systems). There are sometimes bugs in the base OS packages (e.g. [this NFS-related bug](https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1508510)) that can be resolved by a simple upgrade. + +### Ubuntu + +Ubuntu 15.10 for Desktop (and some other versions) doesn't include NFS support by default, so if you get a message like `It appears your machine doesn't support NFS`, then you should do the following to install NFS server: `sudo apt-get install -y nfs-server`. + +### Fedora + +Under Fedora, you might encounter a message like the following upon the first time you use VirtualBox or Vagrant: + +``` +$ vagrant status +VirtualBox is complaining that the kernel module is not loaded. Please +run `VBoxManage --version` or open the VirtualBox GUI to see the error +message which should contain instructions on how to fix this error. +``` + +In this case, you need to install your system's appropriate kernel module, and you'll also need to install `gcc` and run a specific VirtualBox installation script (or reinstall VirtualBox entirely) so the kernel module is loaded correctly. Do the following: + + 1. `sudo dnf install "kernel-devel-uname-r == $(uname -r)"` + 2. `sudo dnf install gcc` + 3. `sudo /var/lib/vboxdrv.sh setup` + +Periodically, when you upgrade your system's Linux kernel, you might need to run steps 2 and 3 above again, or you can uninstall and reinstall VirtualBox (e.g. `sudo dnf remove VirtualBox && sudo dnf install VirtualBox`). + +## Synced Folders + +Most issues have to do synced folders. These are the most common ones: + +### 'Mounting NFS shared folders...' hangs + +There are a few different reasons this particular problem can occur. You may run into the error below during `vagrant up`: + +``` +The following SSH command responded with a non-zero exit status. +Vagrant assumes that this means the command failed! + +mount -o '' 192.168.88.1:'/Users/myusername/Sites/drupalvm' /var/www/drupalvm + +Stdout from the command: + + + +Stderr from the command: + +stdin: is not a tty +mount.nfs: Connection timed out +``` + +If you get this message, then it's likely that either NFS isn't running correctly on your host, certain ports are protocols are being blocked by the system firewall, or you need to add additional mount options to your `vagrant_synced_folders` configuration. Try the following fixes: + + 1. On Ubuntu, if you get a message like `It appears your machine doesn't support NFS`, run `sudo apt-get install -y nfs-server`. + 2. Install the `vagrant-vbguest` plugin, which will make sure you are running the latest version of the VirualBox Guest Additions inside the VM (this can solve many different problems!). + 3. Make sure the `vboxnet` interfaces are not being blocked by your system firewall. For Fedora (and many flavors of Linux), check out this guide for more: [Get Vagrant's NFS working under Fedora 20](http://blog.bak1an.site/blog/2014/03/23/fedora-vagrant-nfs/). + 4. Add `mount_options: ['vers=3']` to your synced folder definition in config.yml after the other options like `local_path`, `destination`, and `type`. + +After attempting any of the above fixes, run `vagrant reload --provision` to restart the VM and attempt mounting the synced folder again, or `vagrant destroy -f && vagrant up` to rebuild the VM from scratch. + +## Intel VT-x virtualization support + +On some laptops, Intel VT-x virtualization (which is built into most modern Intel processors) is enabled by default. This allows VirtualBox to run virtual machines efficiently using the CPU itself instead of software CPU emulation. If you get a message like "VT-x is disabled in the bios for both all cpu modes" or something similar, you may need to enter your computer's BIOS or UEFI settings and enable this virtualization support. diff --git a/mkdocs.yml b/mkdocs.yml index 5c29f2c6a..cfcaa89c7 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -34,6 +34,7 @@ pages: - 'PHP 7 on Drupal VM': 'other/php-7.md' - 'Networking Notes': 'other/networking.md' - 'Drupal 6 Notes': 'other/drupal-6.md' + - 'Linux Notes': 'other/linux.md' - 'Windows Notes': 'other/windows.md' - 'Cloning Drupal VM with newd': 'other/cloning-with-newd.md' - 'Vagrant and VirtualBox Tips': 'other/vagrant-virtualbox.md' From c43e2083716d19ededa51eb0bd626c0d1a3a4ea8 Mon Sep 17 00:00:00 2001 From: Jeff Geerling Date: Thu, 12 Nov 2015 21:07:36 -0600 Subject: [PATCH 0077/1273] Issue #77: Xdebug PHP .ini files are not in cli configuration by default. --- example.config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/example.config.yml b/example.config.yml index bfeb4a2be..c59b4a9ff 100644 --- a/example.config.yml +++ b/example.config.yml @@ -212,7 +212,7 @@ pimpmylog_grant_all_privs: true # XDebug configuration. XDebug is disabled by default for better performance. php_xdebug_default_enable: 0 php_xdebug_coverage_enable: 0 -php_xdebug_cli_enable: 0 +php_xdebug_cli_enable: 1 php_xdebug_remote_enable: 1 php_xdebug_remote_connect_back: 1 # Use PHPSTORM for PHPStorm, sublime.xdebug for Sublime Text. From 8dbc69b10a587eec390335b6c8cdec572786816a Mon Sep 17 00:00:00 2001 From: Jeff Geerling Date: Thu, 12 Nov 2015 22:51:37 -0600 Subject: [PATCH 0078/1273] Issue #77: Default php_enable_php_fpm to 1 so xdebug config works OOTB. --- example.config.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/example.config.yml b/example.config.yml index c59b4a9ff..3c8831c61 100644 --- a/example.config.yml +++ b/example.config.yml @@ -180,6 +180,7 @@ php_version: "5.6" php_memory_limit: "192M" php_display_errors: "On" php_display_startup_errors: "On" +php_enable_php_fpm: 1 php_realpath_cache_size: "1024K" php_sendmail_path: "/usr/sbin/ssmtp -t" php_opcache_enabled_in_ini: true From 10160db65d13a5dff355147eeab7d7134b7ee80c Mon Sep 17 00:00:00 2001 From: Jeff Geerling Date: Thu, 12 Nov 2015 23:06:12 -0600 Subject: [PATCH 0079/1273] Fixes #308: Add .idea and .project to .gitignore. --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index 4d91e90e0..bff5f4950 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,6 @@ .DS_Store +.idea/ +.project/ .vagrant/ vagrant_ansible_inventory_default config.yml From 6f4c2483d47eccb6a4da0ae236ee433f3efaab8f Mon Sep 17 00:00:00 2001 From: Moshe Weitzman Date: Thu, 3 Dec 2015 12:22:57 -0500 Subject: [PATCH 0080/1273] Remove 'id' from code comment Followup to 43da06d92316eebb2abbecd813a4d5dc74a279fc --- example.config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/example.config.yml b/example.config.yml index 3c8831c61..3bcb6d6cd 100644 --- a/example.config.yml +++ b/example.config.yml @@ -15,7 +15,7 @@ vagrant_ip: 192.168.88.88 # See: https://docs.vagrantup.com/v2/networking/public_network.html vagrant_public_ip: "" -# A list of synced folders, with the keys 'local_path', 'destination', 'id', and +# A list of synced folders, with the keys 'local_path', 'destination', and # a 'type' of [nfs|rsync|smb] (leave empty for slow native shares). See # http://docs.drupalvm.com/en/latest/extras/syncing-folders/ for more info. vagrant_synced_folders: From 07488d2b11a5a8deeebf83b95e00c300ee23f961 Mon Sep 17 00:00:00 2001 From: Chapabu Date: Fri, 4 Dec 2015 09:36:38 +0000 Subject: [PATCH 0081/1273] Remove PHP 7 RC comments from docs Removed "PHP 7 is out soon" comments. --- docs/other/php-7.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/other/php-7.md b/docs/other/php-7.md index 35d969ca4..a65334ad0 100644 --- a/docs/other/php-7.md +++ b/docs/other/php-7.md @@ -1,6 +1,6 @@ Many users have requested the ability to easily install PHP 7.x in addition to the already easy-to-configure options of 5.3, 5.4, 5.5, and 5.6. This page will guide you through how to get PHP 7 running on Drupal VM in a few different ways, depending on what type of installation you need. -_At this time (summer 2015), PHP 7 is still in the release candidate stage, and all support is experimental and prone to breaking. Please don't try running PHP 7 on production environments yet!_ +_At this time (Winter 2015), PHP 7 has only recently been released, and all support is experimental and prone to breaking._ ## Ubuntu 14.04 @@ -23,7 +23,7 @@ php_packages: php_mysql_package: php-mysql ``` -Note that there can still be a few inconsistencies with this configuration, especially as PHP 7.0.0 is still in 'release candidate status'. You can also build from source using the same/included `geerlingguy.php` Ansible role, but that process is a bit more involved and for power users comfortable with the process. +Note that there can still be a few inconsistencies with this configuration, especially as PHP 7.0.0 has only recently been released. You can also build from source using the same/included `geerlingguy.php` Ansible role, but that process is a bit more involved and for power users comfortable with the process. ## RedHat/CentOS 7 From 6869c5e07694748597121f3d22143be6eac567d1 Mon Sep 17 00:00:00 2001 From: Jeff Geerling Date: Mon, 7 Dec 2015 11:21:35 -0600 Subject: [PATCH 0082/1273] Issue #332: PHP7 causes fpm error. --- docs/other/php-7.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/other/php-7.md b/docs/other/php-7.md index a65334ad0..ec455b882 100644 --- a/docs/other/php-7.md +++ b/docs/other/php-7.md @@ -21,6 +21,7 @@ php_packages: - php-json - php-opcache php_mysql_package: php-mysql +php_fpm_daemon: php7.0-fpm ``` Note that there can still be a few inconsistencies with this configuration, especially as PHP 7.0.0 has only recently been released. You can also build from source using the same/included `geerlingguy.php` Ansible role, but that process is a bit more involved and for power users comfortable with the process. From 5c41a93a5da0d50cc08e9328d25f475e785d1f5e Mon Sep 17 00:00:00 2001 From: Jeff Geerling Date: Mon, 7 Dec 2015 11:25:04 -0600 Subject: [PATCH 0083/1273] Issue #278: Make Drupal Console install optional. --- README.md | 2 +- example.config.yml | 1 + provisioning/playbook.yml | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 799eb8471..43370eaba 100644 --- a/README.md +++ b/README.md @@ -12,9 +12,9 @@ It will install the following on an Ubuntu 14.04 (by default) linux VM: - PHP 5.6.x (configurable) - MySQL 5.5.x - Drush (configurable) - - Drupal Console (if using Drupal 8+) - Drupal 6.x, 7.x, or 8.x.x (configurable) - Optional: + - Drupal Console - Varnish 4.x (configurable) - Apache Solr 4.10.x (configurable) - Node.js 0.12 (configurable) diff --git a/example.config.yml b/example.config.yml index 3bcb6d6cd..0c2a46fb5 100644 --- a/example.config.yml +++ b/example.config.yml @@ -133,6 +133,7 @@ mysql_users: # to install *any* extras, make set this value to an empty set, e.g. `[]`. installed_extras: - adminer + - drupalconsole - mailhog - memcached # - nodejs diff --git a/provisioning/playbook.yml b/provisioning/playbook.yml index 60b00def0..b3e49d7a8 100644 --- a/provisioning/playbook.yml +++ b/provisioning/playbook.yml @@ -24,9 +24,9 @@ - geerlingguy.php-mysql - geerlingguy.composer - geerlingguy.drush - - { role: geerlingguy.drupal-console, when: drupal_major_version > 7 } # Conditionally-installed roles. + - { role: geerlingguy.drupal-console, when: 'drupal_major_version > 7 and "drupalconsole" in installed_extras' } - { role: geerlingguy.memcached, when: '"memcached" in installed_extras' } - { role: geerlingguy.php-memcached, when: '"memcached" in installed_extras' } - { role: geerlingguy.php-xdebug, when: '"xdebug" in installed_extras' } From f2b164e34ea9c033799add9aa14b349c58abeb13 Mon Sep 17 00:00:00 2001 From: Jeff Geerling Date: Mon, 7 Dec 2015 11:31:45 -0600 Subject: [PATCH 0084/1273] Fixes #332: Update documentation for running PHP 7.0.0+ on Drupal VM. --- docs/other/php-7.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/other/php-7.md b/docs/other/php-7.md index ec455b882..30169fd1c 100644 --- a/docs/other/php-7.md +++ b/docs/other/php-7.md @@ -24,7 +24,9 @@ php_mysql_package: php-mysql php_fpm_daemon: php7.0-fpm ``` -Note that there can still be a few inconsistencies with this configuration, especially as PHP 7.0.0 has only recently been released. You can also build from source using the same/included `geerlingguy.php` Ansible role, but that process is a bit more involved and for power users comfortable with the process. +Also, comment out `memcached` from the `installed_extras` list, as the PHP Memcached extension is not yet available for PHP 7 (as of late 2015). + +You can also build from source using the same/included `geerlingguy.php` Ansible role, but that process is a bit more involved and for power users comfortable with the process. ## RedHat/CentOS 7 From bb729ababf329cad36f4a973dfdfb07021070b0f Mon Sep 17 00:00:00 2001 From: Jeff Geerling Date: Mon, 7 Dec 2015 16:49:21 -0600 Subject: [PATCH 0085/1273] Issue #332: Clean up docs for PHP7 and fix CentOS repo name. --- docs/other/php-7.md | 43 +++++------------------------- provisioning/tasks/init-redhat.yml | 2 +- 2 files changed, 7 insertions(+), 38 deletions(-) diff --git a/docs/other/php-7.md b/docs/other/php-7.md index 30169fd1c..52cdbe26e 100644 --- a/docs/other/php-7.md +++ b/docs/other/php-7.md @@ -1,6 +1,6 @@ -Many users have requested the ability to easily install PHP 7.x in addition to the already easy-to-configure options of 5.3, 5.4, 5.5, and 5.6. This page will guide you through how to get PHP 7 running on Drupal VM in a few different ways, depending on what type of installation you need. +Drupal VM fully supports PHP 7, but currently defaults to 5.6 in order to maximize compatibility with older Drupal 6 and 7 sites. Soon, Drupal VM will change its defaults to install PHP 7.x instead of 5.x, but until then, follow the instructions below to use PHP 7. -_At this time (Winter 2015), PHP 7 has only recently been released, and all support is experimental and prone to breaking._ +_Note: If you have Ansible installed on your host machine, make sure you're running the latest version of all Ansible role dependencies by running `ansible-galaxy install -r provisioning/requirements.txt --force` inside the root Drupal VM project folder._ ## Ubuntu 14.04 @@ -30,39 +30,8 @@ You can also build from source using the same/included `geerlingguy.php` Ansible ## RedHat/CentOS 7 -After configuring Drupal VM to [use a different base OS](https://github.com/geerlingguy/drupal-vm/wiki/Using-Different-Base-OSes) (in this case, CentOS 7), you need to do the following to get PHP 7 running inside the VM: +Remi's RPM repository is included with Drupal VM, and you can make the following changes to use it to install PHP 7: - 1. Make the changes to `config.yml` defined in the code block at the end of these instructions ('Changes to make PHP 7 work...'). - - 2. At this time, automatic install of `xhprof` and `xdebug` are unsupported. Make sure these options are commented or removed from the `installed_extras` setting in `config.yml`. - - 3. Run the normal `vagrant up` as you would with PHP 5.x, but when provisioning fails (usually on the Composer step), log into the VM with `vagrant ssh`, and run the following two commands: - ``` - sudo ln -s /usr/bin/php70 /usr/bin/php - sudo systemctl restart httpd.service - ``` - - 4. Log back out (type `exit` to exit the session in the VM) and run `vagrant provision`. This should pick back up where the provisioning left off earlier, and complete installation. - -Note: Make sure you're running the latest version of all Ansible role dependencies by running `ansible-galaxy install -r provisioning/requirements.txt --force` inside the root Drupal VM project folder. - - # Changes to make PHP 7 work in CentOS via Remi's repo. - php_executable: php70 - php_packages: - - php70 - - php70-php - - php70-fakepear - - php70-php-devel - - php70-php-gd - - php70-php-imap - - php70-php-ldap - - php70-php-mbstring - - php70-php-pdo - - php70-php-process - - php70-php-xml - - php70-php-xmlrpc - php_mysql_package: php70-php-mysqlnd - -## Zend nightly PHP 7 builds - -Zend has a repository with [nightly PHP 7 builds](http://php7.zend.com/repo.php) for either RHEL/CentOS 7 or Debian 8/Ubuntu 14.04, but the repository requires some manual configuration and setup and is not going to be officially supported as a PHP 7 installation method within Drupal VM. + 1. Make sure you've followed the directions for switching to CentOS 7 in the [use a different base OS](https://github.com/geerlingguy/drupal-vm/wiki/Using-Different-Base-OSes) guide. + 2. Change `php_version` inside `config.yml` to `"7.0"`. + 3. Comment `xhprof`, `xdebug`, and `memcached` from the `installed_extras` in `config.yml`, as they're not yet supported. diff --git a/provisioning/tasks/init-redhat.yml b/provisioning/tasks/init-redhat.yml index b95ca9383..5e3a72533 100644 --- a/provisioning/tasks/init-redhat.yml +++ b/provisioning/tasks/init-redhat.yml @@ -18,5 +18,5 @@ when: php_version == "5.6" - name: Enable remi repo for PHP 7.0. - set_fact: php_enablerepo="remi,remi-test" + set_fact: php_enablerepo="remi,remi-php70" when: php_version == "7.0" From 809475e96db9647b5893f1379dd5c17e29f649db Mon Sep 17 00:00:00 2001 From: Jeff Geerling Date: Thu, 10 Dec 2015 23:29:23 -0600 Subject: [PATCH 0086/1273] Fixes #174: Add ability to provide custom shell scripts to run after provisioning. --- .gitignore | 1 + docs/extras/scripts.md | 14 ++++++++++++++ example.config.yml | 5 +++++ mkdocs.yml | 1 + provisioning/playbook.yml | 4 ++++ 5 files changed, 25 insertions(+) create mode 100644 docs/extras/scripts.md diff --git a/.gitignore b/.gitignore index bff5f4950..0c92992e5 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,4 @@ vagrant_ansible_inventory_default config.yml drupal.make.yml examples/prod/inventory +scripts/ \ No newline at end of file diff --git a/docs/extras/scripts.md b/docs/extras/scripts.md new file mode 100644 index 000000000..2b9d4fd5d --- /dev/null +++ b/docs/extras/scripts.md @@ -0,0 +1,14 @@ +Drupal VM allows you to run extra shell scripts at the end of the provisioning process, in case you need to do extra setup, further configure the VM, or install extra software outside the purview of Drupal VM. + +To use an extra script, configure the path to the script (relative to `provisioning/playbook.yml`) in `config.yml`: + +```yaml +post_provision_scripts: + - "../scripts/post-provision.sh" +``` + +The above example results in a `post-provision.sh` script running after the main Drupal VM setup is complete. Note that post provision scripts run _every_ time you the VM is provisioned provision the environment (e.g. when you run `vagrant up` or `vagrant provision`). + +You can define as many scripts as you would like, and any arguments after the path will be passed to the shell script itself (e.g. `"- "../scripts/setup-paths.sh --option"`). + +Place your post-provision scripts inside a `scripts` directory in the root of your Drupal VM project directory; this directory is gitignored, so you can continue to update Drupal VM without overwriting your scripts. diff --git a/example.config.yml b/example.config.yml index 0c2a46fb5..c7e5feecb 100644 --- a/example.config.yml +++ b/example.config.yml @@ -194,6 +194,11 @@ composer_home_path: '/home/vagrant/.composer' # composer_global_packages: # - { name: phpunit/phpunit, release: '@stable' } +# Run specified scripts after VM is provisioned. Path is relative to the +# `provisioning/playbook.yml` file. +post_provision_scripts: [] + # - "../examples/scripts/configure-solr.sh" + # MySQL Configuration. mysql_root_password: root mysql_slow_query_log_enabled: true diff --git a/mkdocs.yml b/mkdocs.yml index cfcaa89c7..dc7253602 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -28,6 +28,7 @@ pages: - 'Debug Code with XDebug': 'extras/xdebug.md' - 'Catch Emails with MailHog': 'extras/mailhog.md' - 'Test with Behat and Selenium': 'extras/behat.md' + - 'Add Post-Provision Scripts': 'extras/scripts.md' - Other Information: - 'Using Different Base OSes': 'other/base-os.md' - 'Using Different Webservers': 'other/webservers.md' diff --git a/provisioning/playbook.yml b/provisioning/playbook.yml index b3e49d7a8..049d2561c 100644 --- a/provisioning/playbook.yml +++ b/provisioning/playbook.yml @@ -66,3 +66,7 @@ - include: tasks/drush-aliases.yml - include: tasks/cron.yml + + - name: Run configured post-provision shell scripts. + script: "{{ item }}" + with_items: post_provision_scripts From 71512f9cd5763b041e89a70ade24de77e3068cf3 Mon Sep 17 00:00:00 2001 From: Jeff Geerling Date: Fri, 11 Dec 2015 09:21:38 -0600 Subject: [PATCH 0087/1273] Fixes #344: Document unsupported PHP extensions for PHP 7. --- docs/other/php-7.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/other/php-7.md b/docs/other/php-7.md index 52cdbe26e..3262f9ca9 100644 --- a/docs/other/php-7.md +++ b/docs/other/php-7.md @@ -24,7 +24,7 @@ php_mysql_package: php-mysql php_fpm_daemon: php7.0-fpm ``` -Also, comment out `memcached` from the `installed_extras` list, as the PHP Memcached extension is not yet available for PHP 7 (as of late 2015). +Also, comment out `xhprof`, `xdebug`, and `memcached` from the `installed_extras` list, as these extensions are not yet supported for PHP 7 (as of late 2015). You can also build from source using the same/included `geerlingguy.php` Ansible role, but that process is a bit more involved and for power users comfortable with the process. @@ -34,4 +34,4 @@ Remi's RPM repository is included with Drupal VM, and you can make the following 1. Make sure you've followed the directions for switching to CentOS 7 in the [use a different base OS](https://github.com/geerlingguy/drupal-vm/wiki/Using-Different-Base-OSes) guide. 2. Change `php_version` inside `config.yml` to `"7.0"`. - 3. Comment `xhprof`, `xdebug`, and `memcached` from the `installed_extras` in `config.yml`, as they're not yet supported. + 3. Comment out `xhprof`, `xdebug`, and `memcached` from the `installed_extras` list, as these extensions are not yet supported for PHP 7 (as of late 2015). From 8bb9f1cffead7eabfcbcea364f505698353c5a9f Mon Sep 17 00:00:00 2001 From: Jeff Geerling Date: Sat, 12 Dec 2015 22:43:00 -0600 Subject: [PATCH 0088/1273] Fixes #289: Add Redis as optional install. --- README.md | 18 ++---------------- docs/other/php-7.md | 4 ++-- example.config.yml | 1 + provisioning/playbook.yml | 2 ++ provisioning/requirements.yml | 2 ++ 5 files changed, 9 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index 43370eaba..8b59b38a0 100644 --- a/README.md +++ b/README.md @@ -21,6 +21,7 @@ It will install the following on an Ubuntu 14.04 (by default) linux VM: - Selenium, for testing your sites via Behat - Ruby - Memcached + - Redis - XHProf, for profiling your code - XDebug, for debugging your code - Adminer, for accessing databases directly @@ -101,22 +102,7 @@ If you don't want or need one or more of these extras, just delete them or comme ## Using Drupal VM -Drupal VM is built to integrate with every developer's workflow. Many guides for using Drupal VM for common development tasks are available on the [Drupal VM documentation site](http://docs.drupalvm.com): - - - [Syncing Folders](http://docs.drupalvm.com/en/latest/extras/syncing-folders/) - - [Connect to the MySQL Database](http://docs.drupalvm.com/en/latest/extras/mysql/) - - [Use Apache Solr for Search](http://docs.drupalvm.com/en/latest/extras/solr/) - - [Use Drush with Drupal VM](http://docs.drupalvm.com/en/latest/extras/drush/) - - [Use Drupal Console with Drupal VM](http://docs.drupalvm.com/en/latest/extras/drupal-console/) - - [Use Varnish with Drupal VM](http://docs.drupalvm.com/en/latest/extras/varnish/) - - [Use MariaDB instead of MySQL](http://docs.drupalvm.com/en/latest/extras/mariadb/) - - [View Logs with Pimp my Log](http://docs.drupalvm.com/en/latest/extras/pimpmylog/) - - [Profile Code with XHProf](http://docs.drupalvm.com/en/latest/extras/xhprof/) - - [Debug Code with XDebug](http://docs.drupalvm.com/en/latest/extras/xdebug/) - - [Catch Emails with MailHog](http://docs.drupalvm.com/en/latest/extras/mailhog/) - - [Test with Behat and Selenium](http://docs.drupalvm.com/en/latest/extras/behat/) - - [PHP 7 on Drupal VM](http://docs.drupalvm.com/en/latest/other/php-7/) - - [Drupal 6 Notes](http://docs.drupalvm.com/en/latest/other/drupal-6/) +Drupal VM is built to integrate with every developer's workflow. Many guides for using Drupal VM for common development tasks are available on the [Drupal VM documentation site](http://docs.drupalvm.com). ## Other Notes diff --git a/docs/other/php-7.md b/docs/other/php-7.md index 3262f9ca9..bc72412d7 100644 --- a/docs/other/php-7.md +++ b/docs/other/php-7.md @@ -24,7 +24,7 @@ php_mysql_package: php-mysql php_fpm_daemon: php7.0-fpm ``` -Also, comment out `xhprof`, `xdebug`, and `memcached` from the `installed_extras` list, as these extensions are not yet supported for PHP 7 (as of late 2015). +Also, comment out `xhprof`, `xdebug`, `redis` and `memcached` from the `installed_extras` list, as these extensions are not yet supported for PHP 7 (as of late 2015). You can also build from source using the same/included `geerlingguy.php` Ansible role, but that process is a bit more involved and for power users comfortable with the process. @@ -34,4 +34,4 @@ Remi's RPM repository is included with Drupal VM, and you can make the following 1. Make sure you've followed the directions for switching to CentOS 7 in the [use a different base OS](https://github.com/geerlingguy/drupal-vm/wiki/Using-Different-Base-OSes) guide. 2. Change `php_version` inside `config.yml` to `"7.0"`. - 3. Comment out `xhprof`, `xdebug`, and `memcached` from the `installed_extras` list, as these extensions are not yet supported for PHP 7 (as of late 2015). + 3. Comment out `xhprof`, `xdebug`, `redis` and `memcached` from the `installed_extras` list, as these extensions are not yet supported for PHP 7 (as of late 2015). diff --git a/example.config.yml b/example.config.yml index c7e5feecb..f09475c7e 100644 --- a/example.config.yml +++ b/example.config.yml @@ -138,6 +138,7 @@ installed_extras: - memcached # - nodejs - pimpmylog + # - redis # - ruby # - selenium # - solr diff --git a/provisioning/playbook.yml b/provisioning/playbook.yml index 049d2561c..4d908cdd6 100644 --- a/provisioning/playbook.yml +++ b/provisioning/playbook.yml @@ -36,6 +36,8 @@ - { role: geerlingguy.daemonize, when: '"mailhog" in installed_extras' } - { role: geerlingguy.mailhog, when: '"mailhog" in installed_extras' } - { role: geerlingguy.nodejs, when: '"nodejs" in installed_extras' } + - { role: geerlingguy.redis, when: '"redis" in installed_extras' } + - { role: geerlingguy.php-redis, when: '"redis" in installed_extras' } - { role: geerlingguy.ruby, when: '"ruby" in installed_extras' } - { role: geerlingguy.java, when: '"solr" in installed_extras or "selenium" in installed_extras' } - { role: arknoll.selenium, when: '"selenium" in installed_extras' } diff --git a/provisioning/requirements.yml b/provisioning/requirements.yml index 1542a8a29..418c6776a 100644 --- a/provisioning/requirements.yml +++ b/provisioning/requirements.yml @@ -18,10 +18,12 @@ - src: geerlingguy.php-memcached - src: geerlingguy.php-mysql - src: geerlingguy.php-pecl +- src: geerlingguy.php-redis - src: geerlingguy.php-xdebug - src: geerlingguy.php-xhprof - src: geerlingguy.pimpmylog - src: geerlingguy.postfix +- src: geerlingguy.redis - src: geerlingguy.repo-remi - src: geerlingguy.ruby - src: geerlingguy.security From e99ae7150adb9efb6c9dc3ea9c02447043da164a Mon Sep 17 00:00:00 2001 From: Jeff Geerling Date: Mon, 14 Dec 2015 08:58:20 -0600 Subject: [PATCH 0089/1273] Fixes #337: PHP 7 documentation needs updating for Nginx. --- docs/other/php-7.md | 14 ++++++++------ example.config.yml | 2 +- examples/acquia/acquia.overrides.yml | 2 +- provisioning/playbook.yml | 5 +++++ provisioning/tasks/init-debian.yml | 1 - provisioning/templates/nginx-vhost.conf.j2 | 6 +++++- 6 files changed, 20 insertions(+), 10 deletions(-) diff --git a/docs/other/php-7.md b/docs/other/php-7.md index bc72412d7..6e5f4a0b8 100644 --- a/docs/other/php-7.md +++ b/docs/other/php-7.md @@ -15,12 +15,12 @@ php_packages: - php7.0-dev - php7.0-fpm - libpcre3-dev - - php-gd - - php-curl - - php-imap - - php-json - - php-opcache -php_mysql_package: php-mysql + - php7.0-gd + - php7.0-curl + - php7.0-imap + - php7.0-json + - php7.0-opcache +php_mysql_package: php7.0-mysql php_fpm_daemon: php7.0-fpm ``` @@ -28,6 +28,8 @@ Also, comment out `xhprof`, `xdebug`, `redis` and `memcached` from the `installe You can also build from source using the same/included `geerlingguy.php` Ansible role, but that process is a bit more involved and for power users comfortable with the process. +**If you're using Nginx** instead of Apache, don't include `libapache2-mod-php7.0` in the `php_packages` list in `config.yml`. + ## RedHat/CentOS 7 Remi's RPM repository is included with Drupal VM, and you can make the following changes to use it to install PHP 7: diff --git a/example.config.yml b/example.config.yml index f09475c7e..6c2659de2 100644 --- a/example.config.yml +++ b/example.config.yml @@ -182,7 +182,7 @@ php_version: "5.6" php_memory_limit: "192M" php_display_errors: "On" php_display_startup_errors: "On" -php_enable_php_fpm: 1 +php_enable_php_fpm: true php_realpath_cache_size: "1024K" php_sendmail_path: "/usr/sbin/ssmtp -t" php_opcache_enabled_in_ini: true diff --git a/examples/acquia/acquia.overrides.yml b/examples/acquia/acquia.overrides.yml index 1cfb9a67b..bcc7cdb85 100644 --- a/examples/acquia/acquia.overrides.yml +++ b/examples/acquia/acquia.overrides.yml @@ -1,4 +1,4 @@ --- vagrant_box: geerlingguy/ubuntu1204 -php_version: "5.5" +php_version: "5.6" solr_version: "4.5.1" diff --git a/provisioning/playbook.yml b/provisioning/playbook.yml index 4d908cdd6..159061292 100644 --- a/provisioning/playbook.yml +++ b/provisioning/playbook.yml @@ -10,6 +10,11 @@ - include: tasks/init-redhat.yml when: ansible_os_family == 'RedHat' + - name: Set the PHP webserver daemon correctly when nginx is in use. + set_fact: + php_webserver_daemon: nginx + when: drupalvm_webserver == 'nginx' + roles: # Essential roles. - { role: geerlingguy.repo-remi, when: ansible_os_family == 'RedHat' } diff --git a/provisioning/tasks/init-debian.yml b/provisioning/tasks/init-debian.yml index 74f842232..7a848f3a3 100644 --- a/provisioning/tasks/init-debian.yml +++ b/provisioning/tasks/init-debian.yml @@ -21,7 +21,6 @@ apt_repository: repo='ppa:ondrej/php5-5.6' when: php_version == "5.6" -# Experimental. - name: Add repository for PHP 7.0. apt_repository: repo='ppa:ondrej/php-7.0' when: php_version == "7.0" diff --git a/provisioning/templates/nginx-vhost.conf.j2 b/provisioning/templates/nginx-vhost.conf.j2 index 7810ac3de..0250d97b6 100644 --- a/provisioning/templates/nginx-vhost.conf.j2 +++ b/provisioning/templates/nginx-vhost.conf.j2 @@ -32,7 +32,11 @@ server { try_files $uri = 404; fastcgi_split_path_info ^(.+\.php)(/.+)$; - fastcgi_pass unix:/var/run/php5-fpm.sock; + {% if php_version == "7.0" and ansible_distribution == "Ubuntu" %} + fastcgi_pass unix:/var/run/php/{{ php_fpm_daemon }}.sock; + {% else %} + fastcgi_pass unix:/var/run/{{ php_fpm_daemon }}.sock; + {% endif %} fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_read_timeout 120; From e68f4f0fd2a340e815a236582b83ca63e008ff1e Mon Sep 17 00:00:00 2001 From: Jeff Geerling Date: Mon, 14 Dec 2015 22:14:22 -0600 Subject: [PATCH 0090/1273] Support Nginx + CentOS 7 + PHP 7 a little nicer. --- provisioning/templates/nginx-vhost.conf.j2 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/provisioning/templates/nginx-vhost.conf.j2 b/provisioning/templates/nginx-vhost.conf.j2 index 0250d97b6..772f96429 100644 --- a/provisioning/templates/nginx-vhost.conf.j2 +++ b/provisioning/templates/nginx-vhost.conf.j2 @@ -34,6 +34,8 @@ server { {% if php_version == "7.0" and ansible_distribution == "Ubuntu" %} fastcgi_pass unix:/var/run/php/{{ php_fpm_daemon }}.sock; + {% elif php_version == "7.0" and ansible_distribution == "CentOS" %} + fastcgi_pass 127.0.0.1:9000; {% else %} fastcgi_pass unix:/var/run/{{ php_fpm_daemon }}.sock; {% endif %} From 50b9ed496c2288b69b151046ff6d4589dfbdd52a Mon Sep 17 00:00:00 2001 From: Jeff Geerling Date: Mon, 14 Dec 2015 23:02:42 -0600 Subject: [PATCH 0091/1273] Remove (Experimental) for PHP 7.0 support. It's official. --- example.config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/example.config.yml b/example.config.yml index 6c2659de2..63a2f9665 100644 --- a/example.config.yml +++ b/example.config.yml @@ -177,7 +177,7 @@ firewall_allowed_tcp_ports: - "8983" firewall_log_dropped_packets: false -# PHP Configuration. Currently-supported versions: 5.5, 5.6, 7.0 (experimental). +# PHP Configuration. Currently-supported versions: 5.5, 5.6, 7.0. php_version: "5.6" php_memory_limit: "192M" php_display_errors: "On" From 374eab31f14c5c14ad2a833e7f5d28d43b7ddb07 Mon Sep 17 00:00:00 2001 From: Jeff Geerling Date: Mon, 14 Dec 2015 23:12:25 -0600 Subject: [PATCH 0092/1273] Support Nginx + CentOS 7 + PHP 5 a little nicer. --- provisioning/templates/nginx-vhost.conf.j2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/provisioning/templates/nginx-vhost.conf.j2 b/provisioning/templates/nginx-vhost.conf.j2 index 772f96429..8d0b57ac6 100644 --- a/provisioning/templates/nginx-vhost.conf.j2 +++ b/provisioning/templates/nginx-vhost.conf.j2 @@ -34,7 +34,7 @@ server { {% if php_version == "7.0" and ansible_distribution == "Ubuntu" %} fastcgi_pass unix:/var/run/php/{{ php_fpm_daemon }}.sock; - {% elif php_version == "7.0" and ansible_distribution == "CentOS" %} + {% elif ansible_distribution == "CentOS" %} fastcgi_pass 127.0.0.1:9000; {% else %} fastcgi_pass unix:/var/run/{{ php_fpm_daemon }}.sock; From 4a5f4865dc9fe41ab9fa6d3b2952824eccfd7ab3 Mon Sep 17 00:00:00 2001 From: Jeff Geerling Date: Fri, 18 Dec 2015 13:54:59 -0600 Subject: [PATCH 0093/1273] Issue #174: Add example scripts. --- examples/scripts/README.md | 18 +++++++++++++++ examples/scripts/configure-solr.sh | 35 ++++++++++++++++++++++++++++++ 2 files changed, 53 insertions(+) create mode 100644 examples/scripts/README.md create mode 100755 examples/scripts/configure-solr.sh diff --git a/examples/scripts/README.md b/examples/scripts/README.md new file mode 100644 index 000000000..8d91b5182 --- /dev/null +++ b/examples/scripts/README.md @@ -0,0 +1,18 @@ +# Example Scripts for Drupal VM + +## Post-Provision Scripts + +Drupal VM allows you to run extra shell scripts at the end of the provisioning process, in case you need to do extra custom setup, configure your environment, or install extra software outside the purview of Drupal VM. + +To use an extra script, configure the path to the script (relative to `provisioning/playbook.yml`) in `config.yml`: + +```yaml +post_provision_scripts: + - "../examples/post-provision.sh" +``` + +The above example results in the example `post-provision.sh` script running after the main Drupal VM setup is complete. Note that this script would run _every_ time you provision the environment (e.g. once when you run `vagrant up`, then again every time you run `vagrant provision` again). + +You can define as many scripts as you would like, and any arguments after the path will be passed to the shell script itself (e.g. `"../examples/post-provision.sh --option"`). + +Generally, you should place your post-provision scripts inside a `scripts` directory in the root of your Drupal VM project directory; this directory is gitignored, so you can continue to update Drupal VM without accidentally overwriting your scripts. diff --git a/examples/scripts/configure-solr.sh b/examples/scripts/configure-solr.sh new file mode 100755 index 000000000..c7e26dc8c --- /dev/null +++ b/examples/scripts/configure-solr.sh @@ -0,0 +1,35 @@ +#!/bin/bash +# +# Example shell script to run post-provisioning. +# +# This script configures the default Apache Solr search core to use one of the +# Drupal Solr module's configurations. This shell script presumes you have +# `solr` in the `installed_extras`, and is currently set up for the D7 versions +# of Apache Solr Search or Search API Solr. + +SOLR_SETUP_COMPLETE_FILE=/etc/drupal_vm_solr_config_complete + +# Search API Solr module. +SOLR_DOWNLOAD=http://ftp.drupal.org/files/projects/search_api_solr-8.x-1.x-dev.tar.gz +SOLR_DOWNLOAD_DIR=/tmp +SOLR_MODULE_NAME=search_api_solr + +# Check to see if we've already performed this setup. +if [ ! -e "$SOLR_SETUP_COMPLETE_FILE" ]; then + # Download and expand the Solr module. + wget -qO- $SOLR_DOWNLOAD | tar xvz -C $SOLR_DOWNLOAD_DIR + + # Copy the Solr configuration into place over the default `collection1` core. + sudo cp -a $SOLR_DOWNLOAD_DIR/$SOLR_MODULE_NAME/solr-conf/4.x/. /var/solr/collection1/conf/ + + # Fix file permissions. + sudo chown -R solr:solr /var/solr/collection1/conf + + # Restart Apache Solr. + sudo service solr restart + + # Create a file to indicate this script has already run. + sudo touch $SOLR_SETUP_COMPLETE_FILE +else + exit 0 +fi From 1b6e7b421b95ded6cfd50a9fb8597c0ce388ac60 Mon Sep 17 00:00:00 2001 From: Jeff Geerling Date: Fri, 18 Dec 2015 23:47:43 -0600 Subject: [PATCH 0094/1273] Fixes #350: Update Nginx vhost template for more optimal Drupal 8 usage. --- provisioning/templates/nginx-vhost.conf.j2 | 24 ++++++++++------------ 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/provisioning/templates/nginx-vhost.conf.j2 b/provisioning/templates/nginx-vhost.conf.j2 index 8d0b57ac6..062a804e3 100644 --- a/provisioning/templates/nginx-vhost.conf.j2 +++ b/provisioning/templates/nginx-vhost.conf.j2 @@ -17,7 +17,7 @@ server { {% if item.is_php is defined and item.is_php %} location / { # Don't touch PHP for static content. - try_files $uri @rewrite; + try_files $uri /index.php?$query_string; } # Don't allow direct access to PHP files in the vendor directory. @@ -27,22 +27,20 @@ server { } # Use fastcgi for all php files. - location ~ \.php$ { - # Secure *.php files. - try_files $uri = 404; - fastcgi_split_path_info ^(.+\.php)(/.+)$; - - {% if php_version == "7.0" and ansible_distribution == "Ubuntu" %} - fastcgi_pass unix:/var/run/php/{{ php_fpm_daemon }}.sock; - {% elif ansible_distribution == "CentOS" %} - fastcgi_pass 127.0.0.1:9000; - {% else %} - fastcgi_pass unix:/var/run/{{ php_fpm_daemon }}.sock; - {% endif %} + location ~ \.php$|^/update.php { + fastcgi_split_path_info ^(.+?\.php)(|/.*)$; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; + fastcgi_intercept_errors on; fastcgi_read_timeout 120; include fastcgi_params; +{% if php_version == "7.0" and ansible_distribution == "Ubuntu" %} + fastcgi_pass unix:/var/run/php/{{ php_fpm_daemon }}.sock; +{% elif ansible_distribution == "CentOS" %} + fastcgi_pass 127.0.0.1:9000; +{% else %} + fastcgi_pass unix:/var/run/{{ php_fpm_daemon }}.sock; +{% endif %} } location @rewrite { From 4893876c5f685dfa3e07646dcc3be22570200675 Mon Sep 17 00:00:00 2001 From: Jeff Geerling Date: Sun, 20 Dec 2015 14:42:51 -0600 Subject: [PATCH 0095/1273] Issue #350 follow-up: Don't leave in D6 Nginx config. --- provisioning/templates/nginx-vhost.conf.j2 | 4 ---- 1 file changed, 4 deletions(-) diff --git a/provisioning/templates/nginx-vhost.conf.j2 b/provisioning/templates/nginx-vhost.conf.j2 index 062a804e3..fbd8136a6 100644 --- a/provisioning/templates/nginx-vhost.conf.j2 +++ b/provisioning/templates/nginx-vhost.conf.j2 @@ -44,11 +44,7 @@ server { } location @rewrite { - # For D7 and above: rewrite ^ /index.php; - - # For Drupal 6 and below: - #rewrite ^/(.*)$ /index.php?q=$1; } location ~ ^/sites/.*/files/styles/ { From cacf9ebd50ae3fcd408b657e8ba81079a90e8988 Mon Sep 17 00:00:00 2001 From: Jeff Geerling Date: Sun, 20 Dec 2015 14:44:18 -0600 Subject: [PATCH 0096/1273] Issue #350 follow-up: adjust SCRIPT_FILENAME for Nginx vhost. --- provisioning/templates/nginx-vhost.conf.j2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/provisioning/templates/nginx-vhost.conf.j2 b/provisioning/templates/nginx-vhost.conf.j2 index fbd8136a6..56f318ed6 100644 --- a/provisioning/templates/nginx-vhost.conf.j2 +++ b/provisioning/templates/nginx-vhost.conf.j2 @@ -30,7 +30,7 @@ server { location ~ \.php$|^/update.php { fastcgi_split_path_info ^(.+?\.php)(|/.*)$; fastcgi_index index.php; - fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; + fastcgi_param SCRIPT_FILENAME $request_filename; fastcgi_intercept_errors on; fastcgi_read_timeout 120; include fastcgi_params; From 27dca1678fc577e49bdd8c3f5d675609360d6560 Mon Sep 17 00:00:00 2001 From: Jeff Geerling Date: Tue, 22 Dec 2015 21:27:14 -0600 Subject: [PATCH 0097/1273] Fixes #356: Allow override of default /vagrant synced folder type. --- Vagrantfile | 10 ++++++---- example.config.yml | 1 + 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/Vagrantfile b/Vagrantfile index 7409b5976..7bbd11e17 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -71,17 +71,19 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| mount_options: synced_folder.include?('mount_options') ? synced_folder['mount_options'] : [] end + # Allow override of the default synced folder type. + config.vm.synced_folder ".", "/vagrant", type: vconfig.include?('vagrant_synced_folder_default_type') ? vconfig['vagrant_default_synced_folder_type'] : 'nfs' + # Provision using Ansible provisioner if Ansible is installed on host. if which('ansible-playbook') config.vm.provision "ansible" do |ansible| ansible.playbook = "#{dir}/provisioning/playbook.yml" ansible.sudo = true end - # Provision using shell provisioner and JJG-Ansible-Windows otherwise. + # Provision using ansible_local provisioner otherwise. else - config.vm.provision "shell" do |sh| - sh.path = "#{dir}/provisioning/JJG-Ansible-Windows/windows.sh" - sh.args = "/provisioning/playbook.yml" + config.vm.provision "ansible_local" do |sh| + ansible.playbook = "provisioning/playbook.yml" end end diff --git a/example.config.yml b/example.config.yml index 63a2f9665..bdf571dab 100644 --- a/example.config.yml +++ b/example.config.yml @@ -3,6 +3,7 @@ # geerlingguy/ubuntu1204, parallels/ubuntu-14.04, etc. vagrant_box: geerlingguy/ubuntu1404 vagrant_user: vagrant +vagrant_synced_folder_default_type: nfs # If you need to run multiple instances of Drupal VM, set a unique hostname, # machine name, and IP address for each instance. From 283614aca52342d654d5dd72f0a11f01e928be2b Mon Sep 17 00:00:00 2001 From: Jeff Geerling Date: Tue, 22 Dec 2015 22:09:31 -0600 Subject: [PATCH 0098/1273] Fixes #355: Use new ansible_local provisioner included with Vagrant 1.8.0+. --- .gitignore | 3 +- README.md | 2 +- Vagrantfile | 12 +++-- provisioning/JJG-Ansible-Windows/LICENSE | 20 -------- provisioning/JJG-Ansible-Windows/README.md | 40 --------------- provisioning/JJG-Ansible-Windows/windows.sh | 57 --------------------- provisioning/playbook.yml | 1 + 7 files changed, 12 insertions(+), 123 deletions(-) delete mode 100644 provisioning/JJG-Ansible-Windows/LICENSE delete mode 100644 provisioning/JJG-Ansible-Windows/README.md delete mode 100644 provisioning/JJG-Ansible-Windows/windows.sh diff --git a/.gitignore b/.gitignore index 0c92992e5..6c93190f9 100644 --- a/.gitignore +++ b/.gitignore @@ -6,4 +6,5 @@ vagrant_ansible_inventory_default config.yml drupal.make.yml examples/prod/inventory -scripts/ \ No newline at end of file +scripts/ +roles/ diff --git a/README.md b/README.md index 8b59b38a0..c1032ad36 100644 --- a/README.md +++ b/README.md @@ -61,7 +61,7 @@ Note for Faster Provisioning (Mac/Linux only): *[Install Ansible](http://docs.an Note for Linux users: *If NFS is not already installed on your host, you will need to install it to use the default NFS synced folder configuration. See guides for [Debian/Ubuntu](https://www.digitalocean.com/community/tutorials/how-to-set-up-an-nfs-mount-on-ubuntu-14-04), [Arch](https://wiki.archlinux.org/index.php/NFS#Installation), and [RHEL/CentOS](https://www.digitalocean.com/community/tutorials/how-to-set-up-an-nfs-mount-on-centos-6).* -Note on versions: *Please make sure you're running the latest stable version of Vagrant, VirtualBox, and Ansible, as the current version of Drupal VM is tested with the latest releases. As of August 2015: Vagrant 1.7.4, VirtualBox 5.0.2, and Ansible 1.9.2.* +Note on versions: *Please make sure you're running the latest stable version of Vagrant, VirtualBox, and Ansible, as the current version of Drupal VM is tested with the latest releases. As of August 2015: Vagrant 1.8.0, VirtualBox 5.0.10, and Ansible 1.9.4.* ### 2 - Build the Virtual Machine diff --git a/Vagrantfile b/Vagrantfile index 7bbd11e17..568c7315a 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -23,6 +23,8 @@ end vconfig = YAML::load_file("#{dir}/config.yml") Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| + + # Networking configuration. config.vm.hostname = vconfig['vagrant_hostname'] if vconfig['vagrant_ip'] == "0.0.0.0" && Vagrant.has_plugin?("vagrant-auto_network") config.vm.network :private_network, :ip => vconfig['vagrant_ip'], :auto_network => true @@ -36,9 +38,11 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| config.vm.network :public_network, ip: vconfig['vagrant_public_ip'] end + # SSH options. config.ssh.insert_key = false config.ssh.forward_agent = true + # Vagrant box. config.vm.box = vconfig['vagrant_box'] # If hostsupdater plugin is installed, add all server names as aliases. @@ -60,6 +64,7 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| end end + # Synced folders. for synced_folder in vconfig['vagrant_synced_folders']; config.vm.synced_folder synced_folder['local_path'], synced_folder['destination'], type: synced_folder['type'], @@ -74,16 +79,15 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| # Allow override of the default synced folder type. config.vm.synced_folder ".", "/vagrant", type: vconfig.include?('vagrant_synced_folder_default_type') ? vconfig['vagrant_default_synced_folder_type'] : 'nfs' - # Provision using Ansible provisioner if Ansible is installed on host. + # Provisioning. Use ansible if it's installed on host, ansible_local if not. if which('ansible-playbook') config.vm.provision "ansible" do |ansible| ansible.playbook = "#{dir}/provisioning/playbook.yml" - ansible.sudo = true end - # Provision using ansible_local provisioner otherwise. else - config.vm.provision "ansible_local" do |sh| + config.vm.provision "ansible_local" do |ansible| ansible.playbook = "provisioning/playbook.yml" + ansible.galaxy_role_file = "provisioning/requirements.yml" end end diff --git a/provisioning/JJG-Ansible-Windows/LICENSE b/provisioning/JJG-Ansible-Windows/LICENSE deleted file mode 100644 index 378188abb..000000000 --- a/provisioning/JJG-Ansible-Windows/LICENSE +++ /dev/null @@ -1,20 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014 Jeff Geerling - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/provisioning/JJG-Ansible-Windows/README.md b/provisioning/JJG-Ansible-Windows/README.md deleted file mode 100644 index f3406ba45..000000000 --- a/provisioning/JJG-Ansible-Windows/README.md +++ /dev/null @@ -1,40 +0,0 @@ -# JJG-Ansible-Windows - -Windows shell provisioning script to bootstrap Ansible from within a Vagrant VM running on Windows. - -This script is configured to use configure any Linux-based VM (Debian, Ubuntu, Fedora, RedHat, CentOS, etc.) so it can run Ansible playbooks from within the VM through Vagrant. - -Read more about this script, and other techniques for using Ansible within a Windows environment, on Server Check.in: [Running Ansible within Windows](https://servercheck.in/blog/running-ansible-within-windows). - -## Usage - -In your Vagrantfile, use a conditional provisioning statement if you want to use this script (which runs Ansible from within the VM instead of on your host—this example assumes your playbook is inside within a 'provisioning' folder, and this script is within provisioning/JJG-Ansible-Windows): - -```ruby -# Use rbconfig to determine if we're on a windows host or not. -require 'rbconfig' -is_windows = (RbConfig::CONFIG['host_os'] =~ /mswin|mingw|cygwin/) -if is_windows - # Provisioning configuration for shell script. - config.vm.provision "shell" do |sh| - sh.path = "provisioning/JJG-Ansible-Windows/windows.sh" - sh.args = "provisioning/playbook.yml" - end -else - # Provisioning configuration for Ansible (for Mac/Linux hosts). - config.vm.provision "ansible" do |ansible| - ansible.playbook = "provisioning/playbook.yml" - ansible.sudo = true - end -end -``` - -Note that the `windows.sh` script will run within the VM and will run the given playbook against localhost with `--connection=local` inside the VM. You shouldn't/can't pass a custom inventory file to the script, as you can using Vagrant's Ansible provisioner. - -### Role Requirements File - -If your playbook requires roles to be installed which are not present in a `roles` directory within the playbook's directory, then you should add the roles to a [role requirements](http://docs.ansible.com/galaxy.html#advanced-control-over-role-requirements-files) file. Place the resulting `requirements.txt` or `requirements.yml` file in the same directory as your playbook, and the roles will be installed automatically. - -## Licensing and More Info - -Created by [Jeff Geerling](http://jeffgeerling.com/) in 2014. Licensed under the MIT license; see the LICENSE file for more info. diff --git a/provisioning/JJG-Ansible-Windows/windows.sh b/provisioning/JJG-Ansible-Windows/windows.sh deleted file mode 100644 index f6d045eef..000000000 --- a/provisioning/JJG-Ansible-Windows/windows.sh +++ /dev/null @@ -1,57 +0,0 @@ -#!/bin/bash -# -# Windows shell provisioner for Ansible playbooks, based on KSid's -# windows-vagrant-ansible: https://github.com/KSid/windows-vagrant-ansible -# -# @see README.md -# @author Jeff Geerling, 2014 - -# Uncomment if behind a proxy server. -# export {http,https,ftp}_proxy='http://username:password@proxy-host:80' - -ANSIBLE_PLAYBOOK=$1 -PLAYBOOK_DIR=${ANSIBLE_PLAYBOOK%/*} - -# Detect package management system. -YUM=$(which yum 2>/dev/null) -APT_GET=$(which apt-get 2>/dev/null) - -# Make sure Ansible playbook exists. -if [ ! -f "/vagrant/$ANSIBLE_PLAYBOOK" ]; then - echo "Cannot find Ansible playbook." - exit 1 -fi - -# Install Ansible and its dependencies if it's not installed already. -if ! command -v ansible >/dev/null; then - echo "Installing Ansible dependencies and Git." - if [[ ! -z ${YUM} ]]; then - yum install -y git python python-devel - elif [[ ! -z ${APT_GET} ]]; then - apt-get install -y git python python-dev - else - echo "Neither yum nor apt-get are available." - exit 1; - fi - - echo "Installing pip via easy_install." - wget https://raw.githubusercontent.com/ActiveState/ez_setup/v0.9/ez_setup.py - python ez_setup.py && rm -f ez_setup.py - easy_install pip - # Make sure setuptools are installed crrectly. - pip install setuptools --no-use-wheel --upgrade - - echo "Installing required python modules." - pip install paramiko pyyaml jinja2 markupsafe - - echo "Installing Ansible." - pip install ansible -fi - -# Install requirements. -echo "Installing Ansible roles from requirements file, if available." -find "/vagrant/$PLAYBOOK_DIR" \( -name "requirements.yml" -o -name "requirements.txt" \) -exec sudo ansible-galaxy install --ignore-errors -r {} \; - -# Run the playbook. -echo "Running Ansible provisioner defined in Vagrantfile." -ansible-playbook -i 'localhost,' "/vagrant/${ANSIBLE_PLAYBOOK}" --extra-vars "is_windows=true" --connection=local diff --git a/provisioning/playbook.yml b/provisioning/playbook.yml index 159061292..8d50e52cb 100644 --- a/provisioning/playbook.yml +++ b/provisioning/playbook.yml @@ -1,5 +1,6 @@ --- - hosts: all + sudo: yes vars_files: - ../config.yml From 577071da98ca57938d9ea4a227544b55bfe018b3 Mon Sep 17 00:00:00 2001 From: Chris Martin Date: Wed, 23 Dec 2015 01:33:48 -0600 Subject: [PATCH 0099/1273] Update xdebug.md for NetBeans Configuration Thanks for making Drupal VM! It is awesome and I was hoping to contribute back. --- docs/extras/xdebug.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/docs/extras/xdebug.md b/docs/extras/xdebug.md index 0a6adb3f5..ea65942f3 100644 --- a/docs/extras/xdebug.md +++ b/docs/extras/xdebug.md @@ -22,3 +22,14 @@ To use XDebug with Sublime Text, change the `php_xdebug_idekey` variable as show ```yaml php_xdebug_idekey: sublime.xdebug ``` + +## NetBeans and XDebug with Drupal VM + +To use XDebug with NetBeans, change the variables below in `config.yml`, and then run `vagrant provision` to reconfigure the VM. + +NOTE: php_xdebug_remote_port: 9000 will need to be added to your `config.yml` below the idekey. + +```yaml +php_xdebug_idekey: netbeans-xdebug +php_xdebug_remote_port: 9000 +``` From 9b914c0682b8ff2af373cca168ee39aae4537517 Mon Sep 17 00:00:00 2001 From: Vitalii Chernomor Date: Wed, 23 Dec 2015 15:19:16 +0200 Subject: [PATCH 0100/1273] Add .bundle to .gitignore. --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 6c93190f9..9b55c8c6e 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,7 @@ .idea/ .project/ .vagrant/ +.bundle/ vagrant_ansible_inventory_default config.yml drupal.make.yml From 06ec267fb71534a9fa2cd5ca1cee51615d596363 Mon Sep 17 00:00:00 2001 From: Jeff Geerling Date: Sat, 2 Jan 2016 16:19:01 -0600 Subject: [PATCH 0101/1273] PR #363 cleanup-default port is 9000, so remove that config. --- docs/extras/xdebug.md | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/docs/extras/xdebug.md b/docs/extras/xdebug.md index ea65942f3..51a419010 100644 --- a/docs/extras/xdebug.md +++ b/docs/extras/xdebug.md @@ -25,11 +25,8 @@ php_xdebug_idekey: sublime.xdebug ## NetBeans and XDebug with Drupal VM -To use XDebug with NetBeans, change the variables below in `config.yml`, and then run `vagrant provision` to reconfigure the VM. - -NOTE: php_xdebug_remote_port: 9000 will need to be added to your `config.yml` below the idekey. +To use XDebug with NetBeans, change the `php_xdebug_idekey` variable as shown below in `config.yml`, and then run `vagrant provision` to reconfigure the VM. ```yaml php_xdebug_idekey: netbeans-xdebug -php_xdebug_remote_port: 9000 ``` From 5f0d89010d52cbffe067abfbc135278cb06d9e8f Mon Sep 17 00:00:00 2001 From: Jeff Geerling Date: Thu, 7 Jan 2016 10:35:46 -0600 Subject: [PATCH 0102/1273] Use vagrant user for ruby installed gems. --- example.config.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/example.config.yml b/example.config.yml index bdf571dab..eb8789802 100644 --- a/example.config.yml +++ b/example.config.yml @@ -156,6 +156,7 @@ nodejs_version: "0.12" nodejs_npm_global_packages: [] # `ruby` must be in installed_extras for this to work. +ruby_install_gems_user: "{{ vagrant_user }}" ruby_install_gems: [] # You can configure almost anything else on the server in the rest of this file. From 3e981e3208716e40a25b6b077d11086a40377978 Mon Sep 17 00:00:00 2001 From: Jeff Geerling Date: Tue, 12 Jan 2016 11:03:12 -0600 Subject: [PATCH 0103/1273] Use become instead of sudo. --- README.md | 2 +- provisioning/playbook.yml | 2 +- provisioning/tasks/build-makefile.yml | 4 ++-- provisioning/tasks/drush-aliases.yml | 10 +++++----- provisioning/tasks/install-site.yml | 6 +++--- provisioning/tasks/sshd.yml | 4 ++-- 6 files changed, 14 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index c1032ad36..af649be00 100644 --- a/README.md +++ b/README.md @@ -61,7 +61,7 @@ Note for Faster Provisioning (Mac/Linux only): *[Install Ansible](http://docs.an Note for Linux users: *If NFS is not already installed on your host, you will need to install it to use the default NFS synced folder configuration. See guides for [Debian/Ubuntu](https://www.digitalocean.com/community/tutorials/how-to-set-up-an-nfs-mount-on-ubuntu-14-04), [Arch](https://wiki.archlinux.org/index.php/NFS#Installation), and [RHEL/CentOS](https://www.digitalocean.com/community/tutorials/how-to-set-up-an-nfs-mount-on-centos-6).* -Note on versions: *Please make sure you're running the latest stable version of Vagrant, VirtualBox, and Ansible, as the current version of Drupal VM is tested with the latest releases. As of August 2015: Vagrant 1.8.0, VirtualBox 5.0.10, and Ansible 1.9.4.* +Note on versions: *Please make sure you're running the latest stable version of Vagrant, VirtualBox, and Ansible, as the current version of Drupal VM is tested with the latest releases. As of August 2015: Vagrant 1.8.0, VirtualBox 5.0.12, and Ansible 2.0.0.* ### 2 - Build the Virtual Machine diff --git a/provisioning/playbook.yml b/provisioning/playbook.yml index 8d50e52cb..03c422f65 100644 --- a/provisioning/playbook.yml +++ b/provisioning/playbook.yml @@ -1,6 +1,6 @@ --- - hosts: all - sudo: yes + become: yes vars_files: - ../config.yml diff --git a/provisioning/tasks/build-makefile.yml b/provisioning/tasks/build-makefile.yml index ef1be3a47..39cf33d98 100644 --- a/provisioning/tasks/build-makefile.yml +++ b/provisioning/tasks/build-makefile.yml @@ -4,7 +4,7 @@ path: "{{ drupal_core_path }}" state: directory mode: 0775 - sudo: no + become: no when: drupal_site.stat.exists == false - name: Generate Drupal site with drush makefile. @@ -12,4 +12,4 @@ {{ drush_path }} make -y {{ drush_makefile_path }} --no-gitinfofile chdir={{ drupal_core_path }} when: drupal_site.stat.exists == false - sudo: no + become: no diff --git a/provisioning/tasks/drush-aliases.yml b/provisioning/tasks/drush-aliases.yml index 9f89d03ba..71740ece9 100644 --- a/provisioning/tasks/drush-aliases.yml +++ b/provisioning/tasks/drush-aliases.yml @@ -1,13 +1,13 @@ --- - name: Ensure drush directory exists for vagrant user inside VM. file: 'path="~/.drush" state=directory' - sudo: no + become: no - name: Configure drush aliases for vagrant user inside VM. template: src: ../templates/drupalvm-local.aliases.drushrc.php.j2 dest: "~/.drush/{{ vagrant_machine_name }}.aliases.drushrc.php" - sudo: no + become: no - name: Ensure drush directory exists for root user inside VM. file: 'path="~/.drush" state=directory' @@ -22,7 +22,7 @@ path: ~/.drush register: local_drush_config_folder delegate_to: 127.0.0.1 - sudo: no + become: no when: configure_local_drush_aliases - name: Create Drush configuration folder if it doesn't exist. @@ -30,7 +30,7 @@ path: ~/.drush state: directory delegate_to: 127.0.0.1 - sudo: no + become: no when: configure_local_drush_aliases and (local_drush_config_folder.stat.exists == false) # Note that this doesn't work for Windows, since Ansible's running in the VM. @@ -39,5 +39,5 @@ src: ../templates/drupalvm.aliases.drushrc.php.j2 dest: "~/.drush/{{ vagrant_machine_name }}.aliases.drushrc.php" delegate_to: 127.0.0.1 - sudo: no + become: no when: configure_local_drush_aliases diff --git a/provisioning/tasks/install-site.yml b/provisioning/tasks/install-site.yml index b91c0e08d..9ddf99254 100644 --- a/provisioning/tasks/install-site.yml +++ b/provisioning/tasks/install-site.yml @@ -6,7 +6,7 @@ register: drupal_site_installed failed_when: false changed_when: false - sudo: no + become: no - name: Install Drupal with drush. command: > @@ -19,11 +19,11 @@ chdir={{ drupal_core_path }} notify: restart webserver when: "'Successful' not in drupal_site_installed.stdout" - sudo: no + become: no - name: Install configured modules with drush. command: > {{ drush_path }} pm-enable -y {{ drupal_enable_modules | join(" ") }} chdir={{ drupal_core_path }} when: "'Successful' not in drupal_site_installed.stdout" - sudo: no + become: no diff --git a/provisioning/tasks/sshd.yml b/provisioning/tasks/sshd.yml index 1d8f4c5e3..be492d667 100644 --- a/provisioning/tasks/sshd.yml +++ b/provisioning/tasks/sshd.yml @@ -10,12 +10,12 @@ stat: "path={{ known_hosts_path | default('~/.ssh/known_hosts') }}" register: known_hosts_file connection: local - sudo: no + become: no - name: Copy known_hosts file from host into Drupal VM. copy: src: "{{ known_hosts_path | default('~/.ssh/known_hosts') }}" dest: ~/.ssh/known_hosts mode: 0644 - sudo: no + become: no when: known_hosts_file.stat.exists From 434865124ea7c8da58edeee1a845070437bbd9b0 Mon Sep 17 00:00:00 2001 From: Jeff Geerling Date: Thu, 14 Jan 2016 22:42:47 -0600 Subject: [PATCH 0104/1273] Fixes #346: Switch Apache to use FPM instead of mod_php. --- docs/other/base-os.md | 2 ++ example.config.yml | 2 ++ provisioning/playbook.yml | 1 + provisioning/requirements.yml | 1 + provisioning/templates/nginx-vhost.conf.j2 | 6 ------ 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/other/base-os.md b/docs/other/base-os.md index 3aaf61cbb..6646f1140 100644 --- a/docs/other/base-os.md +++ b/docs/other/base-os.md @@ -31,6 +31,8 @@ mysql_pid_file: /var/run/mariadb/mariadb.pid ## RedHat Enterprise Linux / CentOS 6 +**Apache without FastCGI**: If you want to use Apache with CentOS 6 on Drupal VM, you will need to modify the syntax of your `apache_vhosts` and remove the `ProxyPassMatch` parameters from each one. Alternatively, you can use Nginx with the default configuration by setting `drupalvm_webserver: nginx` inside `config.yml`. + **PHP OpCache**: PHP's OpCache (if you're using PHP > 5.5) requires the following setting to be configured in `config.yml` (see upstream bug: [CentOS (6) needs additional php-opcache package](https://github.com/geerlingguy/ansible-role-php/issues/39)): ```yaml diff --git a/example.config.yml b/example.config.yml index eb8789802..c1ffbb779 100644 --- a/example.config.yml +++ b/example.config.yml @@ -79,6 +79,8 @@ configure_local_drush_aliases: true apache_vhosts: - servername: "{{ drupal_domain }}" documentroot: "{{ drupal_core_path }}" + extra_parameters: | + ProxyPassMatch ^/(.*\.php(/.*)?)$ "fcgi://127.0.0.1:9000{{ drupal_core_path }}" - servername: "adminer.drupalvm.dev" documentroot: "/opt/adminer" diff --git a/provisioning/playbook.yml b/provisioning/playbook.yml index 03c422f65..9b197bcdc 100644 --- a/provisioning/playbook.yml +++ b/provisioning/playbook.yml @@ -23,6 +23,7 @@ - geerlingguy.git - geerlingguy.postfix - { role: geerlingguy.apache, when: drupalvm_webserver == 'apache' } + - { role: geerlingguy.apache-php-fpm, when: drupalvm_webserver == 'apache' } - { role: geerlingguy.nginx, when: drupalvm_webserver == 'nginx' } - geerlingguy.mysql - geerlingguy.php diff --git a/provisioning/requirements.yml b/provisioning/requirements.yml index 418c6776a..3e6295a95 100644 --- a/provisioning/requirements.yml +++ b/provisioning/requirements.yml @@ -2,6 +2,7 @@ - src: arknoll.selenium - src: geerlingguy.adminer - src: geerlingguy.apache +- src: geerlingguy.apache-php-fpm - src: geerlingguy.composer - src: geerlingguy.daemonize - src: geerlingguy.drupal-console diff --git a/provisioning/templates/nginx-vhost.conf.j2 b/provisioning/templates/nginx-vhost.conf.j2 index 56f318ed6..ef2873f0f 100644 --- a/provisioning/templates/nginx-vhost.conf.j2 +++ b/provisioning/templates/nginx-vhost.conf.j2 @@ -34,13 +34,7 @@ server { fastcgi_intercept_errors on; fastcgi_read_timeout 120; include fastcgi_params; -{% if php_version == "7.0" and ansible_distribution == "Ubuntu" %} - fastcgi_pass unix:/var/run/php/{{ php_fpm_daemon }}.sock; -{% elif ansible_distribution == "CentOS" %} fastcgi_pass 127.0.0.1:9000; -{% else %} - fastcgi_pass unix:/var/run/{{ php_fpm_daemon }}.sock; -{% endif %} } location @rewrite { From 124d7a35650bac0252b732eb584bc71533ab083e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oskar=20Sch=C3=B6ldstr=C3=B6m?= Date: Sun, 1 Nov 2015 11:09:36 -0500 Subject: [PATCH 0105/1273] add support for overriding any synced_folder option --- Vagrantfile | 7 ++++++- docs/extras/syncing-folders.md | 24 ++++++++++++++++++++++++ 2 files changed, 30 insertions(+), 1 deletion(-) diff --git a/Vagrantfile b/Vagrantfile index 568c7315a..3e8fcf875 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -66,7 +66,7 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| # Synced folders. for synced_folder in vconfig['vagrant_synced_folders']; - config.vm.synced_folder synced_folder['local_path'], synced_folder['destination'], + options = { type: synced_folder['type'], rsync__auto: "true", rsync__exclude: synced_folder['excluded_paths'], @@ -74,6 +74,11 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| id: synced_folder['id'], create: synced_folder.include?('create') ? synced_folder['create'] : false, mount_options: synced_folder.include?('mount_options') ? synced_folder['mount_options'] : [] + } + if synced_folder.include?('options_override'); + options = options.merge(synced_folder['options_override']) + end + config.vm.synced_folder synced_folder['local_path'], synced_folder['destination'], options end # Allow override of the default synced folder type. diff --git a/docs/extras/syncing-folders.md b/docs/extras/syncing-folders.md index 258bca15b..0b0bf021b 100644 --- a/docs/extras/syncing-folders.md +++ b/docs/extras/syncing-folders.md @@ -12,6 +12,30 @@ vagrant_synced_folders: You can add as many synced folders as you'd like, and you can configure [any type of share](https://docs.vagrantup.com/v2/synced-folders/index.html) supported by Vagrant; just add another item to the list of `vagrant_synced_folders`. +## Options + +The synced folder options exposed are `type`, `excluded_paths` (when using rsync), `id`, `create` and `mount_options`. Besides these there are some sane defaults set when using rsync. For example all files synced with rsync will be writable by everyone, thus allowing the web server to create files. + +### Overriding defaults + +If you feel the need to fine-tune some of the options not exposed, the entire options hash passed to Vagrant can be overriden using `options_override`. + +The merge of the default options and `options_override` is shallow, so you can use it to remove flags from eg. `rsync__args`. + +One scenario where this might be useful is when you are moving generated code from the virtual machine back to your local machine and you want the files to have appropriate permissions instead of the default 666/777. + +```yaml +options_override: + # Disable the default recursive chown so that the files/ folder won't be affected + rsync__chown: false + rsync__args: [ + "--verbose", "--archive", "--delete", + "--chmod=gu=rwX,o=rX", # 664 for files, 775 for directories + "--owner", "--group", # required for the following command + "--usermap=*:vagrant", "--groupmap=*:www-data" + ] +``` + ## Synced Folder Performance Using different synced folder mechanisms can have a dramatic impact on your Drupal site's performance. Please read through the following blog posts for a thorough overview of synced folder performance: From 4a74598269702798246d04e2311cadf1b0db6d0b Mon Sep 17 00:00:00 2001 From: Jeff Geerling Date: Fri, 15 Jan 2016 17:21:26 -0600 Subject: [PATCH 0106/1273] Add autoCommit time limit reduction to example Solr setup script. --- examples/scripts/configure-solr.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/examples/scripts/configure-solr.sh b/examples/scripts/configure-solr.sh index c7e26dc8c..77ca87c52 100755 --- a/examples/scripts/configure-solr.sh +++ b/examples/scripts/configure-solr.sh @@ -22,6 +22,9 @@ if [ ! -e "$SOLR_SETUP_COMPLETE_FILE" ]; then # Copy the Solr configuration into place over the default `collection1` core. sudo cp -a $SOLR_DOWNLOAD_DIR/$SOLR_MODULE_NAME/solr-conf/4.x/. /var/solr/collection1/conf/ + # Adjust the autoCommit time so index changes are committed in 1s. + sudo sed -i 's/\(\)\([^<]*\)\(<[^>]*\)/\11000\3/g' /var/solr/collection1/conf/solrconfig.xml + # Fix file permissions. sudo chown -R solr:solr /var/solr/collection1/conf From 6c8d4b0abb3b488cd6084406e5863159c291adcf Mon Sep 17 00:00:00 2001 From: Jeff Geerling Date: Mon, 25 Jan 2016 09:46:04 -0600 Subject: [PATCH 0107/1273] Fixes #393: Document required change to switch from PHP-FPM to mod_php for Apache. --- example.config.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/example.config.yml b/example.config.yml index c1ffbb779..fe3e3e6be 100644 --- a/example.config.yml +++ b/example.config.yml @@ -186,7 +186,6 @@ php_version: "5.6" php_memory_limit: "192M" php_display_errors: "On" php_display_startup_errors: "On" -php_enable_php_fpm: true php_realpath_cache_size: "1024K" php_sendmail_path: "/usr/sbin/ssmtp -t" php_opcache_enabled_in_ini: true @@ -194,6 +193,11 @@ php_opcache_memory_consumption: "192" php_opcache_max_accelerated_files: 4096 php_max_input_vars: "4000" +# Drupal VM defaults to using PHP-FPM with either Apache or Nginx. If you wish +# to instead use Apache + mod_php with an Ubuntu base box, make sure you add +# libapache2-mod-php5 to `extra_packages` elsewhere in this config file. +php_enable_php_fpm: true + composer_path: /usr/bin/composer composer_home_path: '/home/vagrant/.composer' # composer_global_packages: From 9b014eae9ae166c66b692ab0bb42881821b77c3d Mon Sep 17 00:00:00 2001 From: Jeff Geerling Date: Mon, 25 Jan 2016 09:53:06 -0600 Subject: [PATCH 0108/1273] Fixes #387: Add php-fpm configuration for other default vhosts. --- example.config.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/example.config.yml b/example.config.yml index fe3e3e6be..67bd26b37 100644 --- a/example.config.yml +++ b/example.config.yml @@ -84,12 +84,18 @@ apache_vhosts: - servername: "adminer.drupalvm.dev" documentroot: "/opt/adminer" + extra_parameters: | + ProxyPassMatch ^/(.*\.php(/.*)?)$ "unix:/var/run/php5-fpm.sock|fcgi://127.0.0.1:9000/opt/adminer" - servername: "xhprof.drupalvm.dev" documentroot: "/usr/share/php/xhprof_html" + extra_parameters: | + ProxyPassMatch ^/(.*\.php(/.*)?)$ "unix:/var/run/php5-fpm.sock|fcgi://127.0.0.1:9000/usr/share/php/xhprof_html" - servername: "pimpmylog.drupalvm.dev" documentroot: "/usr/share/php/pimpmylog" + extra_parameters: | + ProxyPassMatch ^/(.*\.php(/.*)?)$ "unix:/var/run/php5-fpm.sock|fcgi://127.0.0.1:9000/usr/share/php/pimpmylog" apache_remove_default_vhost: true apache_mods_enabled: @@ -197,6 +203,7 @@ php_max_input_vars: "4000" # to instead use Apache + mod_php with an Ubuntu base box, make sure you add # libapache2-mod-php5 to `extra_packages` elsewhere in this config file. php_enable_php_fpm: true +php_fpm_listen: "127.0.0.1:9000" composer_path: /usr/bin/composer composer_home_path: '/home/vagrant/.composer' From d26736218f0e9020f8d87db1210b52bd481fb450 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oskar=20Sch=C3=B6ldstr=C3=B6m?= Date: Mon, 25 Jan 2016 16:38:12 -0500 Subject: [PATCH 0109/1273] docs: update vagrant_synced_folders defaults - drupaltest.dev -> drupalvm.dev - e4ee925186449414612c8cc1d90cada8863f40de - 43da06d92316eebb2abbecd813a4d5dc74a279fc --- docs/deployment/drush-make.md | 2 +- docs/deployment/local-codebase.md | 1 - docs/extras/behat.md | 12 +++---- docs/extras/drupal-console.md | 4 +-- docs/extras/drush.md | 54 +++++++++++++++---------------- docs/extras/mailhog.md | 2 +- docs/extras/solr.md | 2 +- docs/extras/syncing-folders.md | 17 +++------- docs/other/cloning-with-newd.md | 2 +- 9 files changed, 43 insertions(+), 53 deletions(-) diff --git a/docs/deployment/drush-make.md b/docs/deployment/drush-make.md index b777221b9..433fc6808 100644 --- a/docs/deployment/drush-make.md +++ b/docs/deployment/drush-make.md @@ -1,4 +1,4 @@ -Drupal VM is configured by default to use a Drush make file to build a Drupal site on the VM inside `/var/www/drupal` (in a folder that's synced to your local machine, so you can work with the Drupal codebase either locally or inside the VM). +Drupal VM is configured by default to use a Drush make file to build a Drupal site on the VM inside `/var/www/drupalvm/drupal` (in a folder that's synced to your local machine, so you can work with the Drupal codebase either locally or inside the VM). You can use any make file you want, just copy it or symlink it into the root of the Drupal VM folder with the filename `drupal.make.yml`. You can also set a separate path to the makefile using the `drush_makefile_path` variable. diff --git a/docs/deployment/local-codebase.md b/docs/deployment/local-codebase.md index 047ca54b1..67969733e 100644 --- a/docs/deployment/local-codebase.md +++ b/docs/deployment/local-codebase.md @@ -8,7 +8,6 @@ Update the `vagrant_synced_folders` configuration to sync your local Drupal code vagrant_synced_folders: - local_path: ~/Sites/my-drupal-site destination: /var/www/my-drupal-site - id: drupal type: nfs ``` diff --git a/docs/extras/behat.md b/docs/extras/behat.md index 257ef5beb..32de03a38 100644 --- a/docs/extras/behat.md +++ b/docs/extras/behat.md @@ -30,9 +30,9 @@ _You can also include the `behat/*` and `drupal/drupal-extension` directly in yo ## Setting up Behat for your project -Using the default Drupal site as an example (it's installed in `/var/www/drupal` by default, and is shared to `~/Sites/drupalvm/drupal` on your host machine), the following steps will help you get your first Behat tests up and running! +Using the default Drupal site as an example (it's installed in `/var/www/drupalvm/drupal` by default, and is shared to `~/Sites/drupalvm/drupal` on your host machine), the following steps will help you get your first Behat tests up and running! - 1. Create a `behat.yml` file inside the docroot of your site (e.g. create this file alongside the rest of the Drupal codebase at `/var/www/drupal/behat.yml`), with the following contents: + 1. Create a `behat.yml` file inside the docroot of your site (e.g. create this file alongside the rest of the Drupal codebase at `/var/www/drupalvm/drupal/behat.yml`), with the following contents: default: suites: @@ -55,23 +55,23 @@ Using the default Drupal site as an example (it's installed in `/var/www/drupal` blackbox: ~ api_driver: 'drupal' drupal: - drupal_root: '/var/www/drupal' + drupal_root: '/var/www/drupalvm/drupal' region_map: content: "#content" - 2. Log into Drupal VM with `vagrant ssh`, change directory to the Drupal site root (`cd /var/www/drupal`), then run `behat --init` to initialize the `features` folder where you will place test cases. + 2. Log into Drupal VM with `vagrant ssh`, change directory to the Drupal site root (`cd /var/www/drupalvm/drupal`), then run `behat --init` to initialize the `features` folder where you will place test cases. 3. From either inside the VM or on the host machine, open up the new `features/web` folder Behat just created. Inside _that_ folder, create `HomeContent.feature` with the following contents: Feature: Test DrupalContext In order to prove the Behat is working correctly in Drupal VM As a developer I need to run a simple interface test - + Scenario: Viewing content in a region Given I am on the homepage Then I should see "No front page content has been created yet" in the "content" - 4. Now, inside Drupal VM, change directory to `/var/www/drupal` again, and run the command `behat` (which runs all the tests you've created—which should just be one so far). + 4. Now, inside Drupal VM, change directory to `/var/www/drupalvm/drupal` again, and run the command `behat` (which runs all the tests you've created—which should just be one so far). If everything was done correctly, you should see: diff --git a/docs/extras/drupal-console.md b/docs/extras/drupal-console.md index 1b050744e..e6030cd56 100644 --- a/docs/extras/drupal-console.md +++ b/docs/extras/drupal-console.md @@ -5,13 +5,13 @@ Drupal VM will automatically install Drupal Console if you install Drupal 8 or l To use Drupal Console with a Drupal 8 site (in this case, using the default configuration that ships with Drupal VM): 1. Log into the VM with `vagrant ssh`. - 2. Change directory to the Drupal site's document root: `cd /var/www/drupal`. + 2. Change directory to the Drupal site's document root: `cd /var/www/drupalvm/drupal`. 3. Use Drupal console (e.g. `drupal cache:rebuild --cache=all`). You should see an output like: ``` -vagrant@drupaltest:/var/www/drupal$ drupal cache:rebuild --cache=all +vagrant@drupalvm:/var/www/drupalvm/drupal$ drupal cache:rebuild --cache=all [+] Rebuilding cache(s), wait a moment please. [+] Done clearing cache(s). diff --git a/docs/extras/drush.md b/docs/extras/drush.md index 11879ce89..e29d6c0c3 100644 --- a/docs/extras/drush.md +++ b/docs/extras/drush.md @@ -1,34 +1,34 @@ If you have Drush installed on your host workstation, and would like to interact with a Drupal site running inside Drupal VM, there are drush aliases automatically created by Drupal VM for each of the virtual hosts you have configured. -With the example configuration, you can manage the example Drupal site using the Drush alias `@drupaltest.dev`. For example, to check if Drush can connect to the site in Drupal VM, run: +With the example configuration, you can manage the example Drupal site using the Drush alias `@drupalvm.dev`. For example, to check if Drush can connect to the site in Drupal VM, run: ``` -$ drush @drupaltest.dev status - Drupal version : 8.0.0-dev - Site URI : drupaltest.dev - Database driver : mysql - Database hostname : localhost - Database port : - Database username : drupal - Database name : drupal - Database : Connected - Drupal bootstrap : Successful - Drupal user : Anonymous - Default theme : bartik - Administration theme : seven - PHP executable : /usr/bin/php - PHP configuration : /etc/php5/cli/php.ini - PHP OS : Linux - Drush script : /usr/local/share/drush/drush.php - Drush version : 7.0-dev - Drush temp directory : /tmp - Drush configuration : - Drush alias files : - Drupal root : /var/www/drupal - Site path : sites/default - File directory path : sites/default/files - Temporary file : /tmp - directory path +$ drush @drupalvm.dev status + Drupal version : 8.0.0-dev + Site URI : drupalvm.dev + Database driver : mysql + Database hostname : localhost + Database port : + Database username : drupal + Database name : drupal + Database : Connected + Drupal bootstrap : Successful + Drupal user : Anonymous + Default theme : bartik + Administration theme : seven + PHP executable : /usr/bin/php + PHP configuration : /etc/php5/cli/php.ini + PHP OS : Linux + Drush script : /usr/local/share/drush/drush.php + Drush version : 7.0-dev + Drush temp directory : /tmp + Drush configuration : + Drush alias files : + Drupal root : /var/www/drupalvm/drupal + Site path : sites/default + File directory path : sites/default/files + Temporary file : /tmp + directory path Active config path : [...] Staging config path : [...] ``` diff --git a/docs/extras/mailhog.md b/docs/extras/mailhog.md index aea4a85dd..e7d5d0350 100644 --- a/docs/extras/mailhog.md +++ b/docs/extras/mailhog.md @@ -1,3 +1,3 @@ -By default, Drupal VM redirects all PHP emails to [MailHog](https://github.com/mailhog/MailHog) (instead of sending them to the outside world). You can access the MailHog UI at `http://drupaltest.dev:8025/` (or whatever domain you have configured in `config.yml`). +By default, Drupal VM redirects all PHP emails to [MailHog](https://github.com/mailhog/MailHog) (instead of sending them to the outside world). You can access the MailHog UI at `http://drupalvm.dev:8025/` (or whatever domain you have configured in `config.yml`). You can override the default behavior of redirecting email to MailHog by editing or removing the `php_sendmail_path` inside `config.yml`, and you can choose to not install MailHog at all by removing it from `installed_extras` in `config.yml`. \ No newline at end of file diff --git a/docs/extras/solr.md b/docs/extras/solr.md index 73119dfe7..3c4bf0598 100644 --- a/docs/extras/solr.md +++ b/docs/extras/solr.md @@ -6,7 +6,7 @@ The URL to connect to the local solr server (assuming you're using the default ` http://localhost:8983/solr/collection1 -This will connect to the default search core (`collection1`) set up by Solr. If you are using a multisite installation and want to have a search core per Drupal site, you can add more cores through Apache Solr's admin interface (visit `http://drupaltest.dev:8983/solr/`), then connect to each core by adding the core name to the end of the above URL (e.g. `core2` would be `http://localhost:8983/solr/core2`). +This will connect to the default search core (`collection1`) set up by Solr. If you are using a multisite installation and want to have a search core per Drupal site, you can add more cores through Apache Solr's admin interface (visit `http://drupalvm.dev:8983/solr/`), then connect to each core by adding the core name to the end of the above URL (e.g. `core2` would be `http://localhost:8983/solr/core2`). ## Configuring the Solr search core for Drupal diff --git a/docs/extras/syncing-folders.md b/docs/extras/syncing-folders.md index 0b0bf021b..b1581fad3 100644 --- a/docs/extras/syncing-folders.md +++ b/docs/extras/syncing-folders.md @@ -1,16 +1,15 @@ -You can share folders between your host computer and the VM in a variety of ways; the most commonly-used method is an NFS share. If you use Windows and encounter any problems with NFS, try switching to `smb`. The `example.config.yml` file contains an example `nfs` share that would sync the folder `~/Sites/drupalvm` on your host into the `/var/www` folder on Drupal VM. +You can share folders between your host computer and the VM in a variety of ways; the most commonly-used method is an NFS share. If you use Windows and encounter any problems with NFS, try switching to `smb`. The `example.config.yml` file contains an example `nfs` share that would sync the folder `~/Sites/drupalvm` on your host into the `/var/www/drupalvm` folder on Drupal VM. If you want to use a different synced folder method (e.g. `smb`), you can change `type` to: ```yaml vagrant_synced_folders: - local_path: ~/Sites/drupalvm - destination: /var/www - id: drupal + destination: /var/www/drupalvm type: smb ``` -You can add as many synced folders as you'd like, and you can configure [any type of share](https://docs.vagrantup.com/v2/synced-folders/index.html) supported by Vagrant; just add another item to the list of `vagrant_synced_folders`. +You can add as many synced folders as you'd like, and you can configure [any type of share](https://www.vagrantup.com/docs/synced-folders/index.html) supported by Vagrant; just add another item to the list of `vagrant_synced_folders`. ## Options @@ -55,8 +54,7 @@ If you are using rsync, it is advised to exclude certain directories so that the ```yaml vagrant_synced_folders: - local_path: ~/Sites/drupalvm/drupal - destination: /var/www - id: drupal + destination: /var/www/drupalvm type: rsync excluded_paths: - drupal/private @@ -79,7 +77,6 @@ You can use a native synced folder, which should work pretty flawlessly on any p vagrant_synced_folders: - local_path: docroot destination: /var/www/docroot - id: drupal type: "" create: true ``` @@ -104,12 +101,6 @@ mount_options: ["dmode=775,fmode=664"] See [this issue](https://github.com/geerlingguy/drupal-vm/issues/66) for more details. -### VirtualBox Symbolic Links - -When using native VirtualBox shares, VirtualBox does not allow guest VMs to create symbolic links on synced folders for security reasons. On CentOS this prevents apache from installing since it will try to make a symlink inside `/var/www/` You can change the Drupal synced_folder to `/var/www/drupal` and the `drupal_core_path` to `/var/www/drupal/docroot` to work around this. - -There are many other potential [solutions](https://www.google.com/search?q=SharedFoldersEnableSymlinksCreate) available on the Internet. - ### Other NFS-related errors If you're having other weird issues, and none of the above fixes helps, you might want to try a different synced folder method (see top of this page), or something like File Conveyor or a special rsync setup (see [here](http://wolfgangziegler.net/auto-rsync-local-changes-to-remote-server#comments) for some examples). \ No newline at end of file diff --git a/docs/other/cloning-with-newd.md b/docs/other/cloning-with-newd.md index 298a65c7d..0a01a6e48 100644 --- a/docs/other/cloning-with-newd.md +++ b/docs/other/cloning-with-newd.md @@ -1,4 +1,4 @@ -@rgoodie created a function called `newd` that clones this repo, uses `sed` to change configuration to Drupal 7 if desired, renames the VM to something other than drupaltest.dev, and kicks off `vagrant up`. +[@rgoodie](https://github.com/rgoodie) created a function called `newd` that clones this repo, uses `sed` to change configuration to Drupal 7 if desired, renames the VM to something other than drupalvm.dev, and kicks off `vagrant up`. Example: From 3523ce2f875c1f96d030b6135777f450808cbf94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oskar=20Sch=C3=B6ldstr=C3=B6m?= Date: Mon, 25 Jan 2016 16:43:53 -0500 Subject: [PATCH 0110/1273] docs: fix syntax --- docs/deployment/local-codebase.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/deployment/local-codebase.md b/docs/deployment/local-codebase.md index 67969733e..77e36c24e 100644 --- a/docs/deployment/local-codebase.md +++ b/docs/deployment/local-codebase.md @@ -21,7 +21,7 @@ build_makefile:: false install_site: false ``` -_If you aren't copying back a database, and want to have Drupal VM run `drush si` for your Drupal site, you can leave `install_site` set to `true` and it will run a site install on your Drupal codebase using the `drupal_*` config variables. +If you aren't copying back a database, and want to have Drupal VM run `drush si` for your Drupal site, you can leave `install_site` set to `true` and it will run a site install on your Drupal codebase using the `drupal_*` config variables. ## Update `apache_vhosts` From 22507ed1a219359d0902bef67f4583a06ddbdbcf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oskar=20Sch=C3=B6ldstr=C3=B6m?= Date: Mon, 25 Jan 2016 16:44:32 -0500 Subject: [PATCH 0111/1273] docs: update apache_vhosts defaults --- docs/deployment/local-codebase.md | 6 ++++-- docs/deployment/multisite.md | 18 +++++++++++++----- 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/docs/deployment/local-codebase.md b/docs/deployment/local-codebase.md index 77e36c24e..7344895fa 100644 --- a/docs/deployment/local-codebase.md +++ b/docs/deployment/local-codebase.md @@ -29,8 +29,10 @@ Add your site to `apache_vhosts`, setting the `documentroot` to the same value a ```yaml apache_vhosts: - - {servername: "local.my-drupal-site.com", documentroot: "/var/www/my-drupal-site"} - - {servername: "local.xhprof.com", documentroot: "/usr/share/php/xhprof_html"} + - servername: "local.my-drupal-site.com" + documentroot: "/var/www/my-drupal-site" + extra_parameters: | + ProxyPassMatch ^/(.*\.php(/.*)?)$ "fcgi://127.0.0.1:9000{{ drupal_core_path }}" ``` ## Update MySQL info diff --git a/docs/deployment/multisite.md b/docs/deployment/multisite.md index d1551378d..92a8d4834 100644 --- a/docs/deployment/multisite.md +++ b/docs/deployment/multisite.md @@ -1,11 +1,19 @@ -For multisite installations, make the changes outlined in the [Local Drupal codebase](https://github.com/geerlingguy/drupal-vm/wiki/Local-Drupal-codebase) guide, but, using the `apache_vhosts` variable, configure as many domains pointing to the same docroot as you need: +For multisite installations, make the changes outlined in the [Local Drupal codebase](local-codebase.md) guide, but, using the `apache_vhosts` variable, configure as many domains pointing to the same docroot as you need: ```yaml apache_vhosts: - - {servername: "local.my-drupal-site.com", documentroot: "/var/www/my-drupal-site"} - - {servername: "local.second-drupal-site.com", documentroot: "/var/www/my-drupal-site"} - - {servername: "local.third-drupal-site.com", documentroot: "/var/www/my-drupal-site"} - - {servername: "local.xhprof.com", documentroot: "/usr/share/php/xhprof_html"} + - servername: "local.my-drupal-site.com" + documentroot: "/var/www/my-drupal-site" + extra_parameters: | + ProxyPassMatch ^/(.*\.php(/.*)?)$ "fcgi://127.0.0.1:9000{{ drupal_core_path }}" + - servername: "local.second-drupal-site.com" + documentroot: "/var/www/my-drupal-site" + extra_parameters: | + ProxyPassMatch ^/(.*\.php(/.*)?)$ "fcgi://127.0.0.1:9000{{ drupal_core_path }}" + - servername: "local.third-drupal-site.com" + documentroot: "/var/www/my-drupal-site" + extra_parameters: | + ProxyPassMatch ^/(.*\.php(/.*)?)$ "fcgi://127.0.0.1:9000{{ drupal_core_path }}" ``` If you need additional databases and database users, add them to the list of `mysql_databases` and `mysql_users`: From 86a797c36ba64d36f9865a9c368eff0d9a365eb9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oskar=20Sch=C3=B6ldstr=C3=B6m?= Date: Mon, 25 Jan 2016 16:46:56 -0500 Subject: [PATCH 0112/1273] docs: fix links --- docs/deployment/local-codebase.md | 2 +- docs/extras/drupal-console.md | 2 +- docs/extras/nodejs.md | 2 +- docs/extras/syncing-folders.md | 2 +- docs/other/cloning-with-newd.md | 2 +- docs/other/linux.md | 2 +- docs/other/php-7.md | 2 +- docs/other/webservers.md | 4 ++-- 8 files changed, 9 insertions(+), 9 deletions(-) diff --git a/docs/deployment/local-codebase.md b/docs/deployment/local-codebase.md index 7344895fa..d8f85c2b1 100644 --- a/docs/deployment/local-codebase.md +++ b/docs/deployment/local-codebase.md @@ -41,4 +41,4 @@ If you have your Drupal site configured to use a special database and/or user/pa ## Build the VM, import your database -Run `vagrant up` to build the VM with your codebase synced into the proper location. Once the VM is created, you can connect to the MySQL database (see the sidebar topic "MySQL - Connecting to the DB") and import your site's database to the Drupal VM, or use a command like `drush sql-sync` to copy a database from another server. \ No newline at end of file +Run `vagrant up` to build the VM with your codebase synced into the proper location. Once the VM is created, you can [connect to the MySQL database](../extras/mysql.md) and import your site's database to the Drupal VM, or use a command like `drush sql-sync` to copy a database from another server. diff --git a/docs/extras/drupal-console.md b/docs/extras/drupal-console.md index e6030cd56..7c0079691 100644 --- a/docs/extras/drupal-console.md +++ b/docs/extras/drupal-console.md @@ -1,4 +1,4 @@ -[Drupal Console](http://drupalconsole.com/) is a modern CLI for interacting with Drupal and scaffolding a site. It works only with Drupal 8+, and is built on top of the Symfony Console component. +[Drupal Console](https://drupalconsole.com/) is a modern CLI for interacting with Drupal and scaffolding a site. It works only with Drupal 8+, and is built on top of the Symfony Console component. Drupal VM will automatically install Drupal Console if you install Drupal 8 or later in your VM (this is based on the value of the `drupal_major_version` variable inside `config.yml`. diff --git a/docs/extras/nodejs.md b/docs/extras/nodejs.md index 132b59cab..0f5ece5a9 100644 --- a/docs/extras/nodejs.md +++ b/docs/extras/nodejs.md @@ -4,7 +4,7 @@ Drupal VM includes built-in support for Node.js—all you need to do is make sur ## Choosing a version of Node.js -You can choose a version of Node.js to install using the `nodejs_version` variable in `config.yml`. See the `geerlingguy.nodejs` role documentation for all the currently-available versions for your OS. +You can choose a version of Node.js to install using the `nodejs_version` variable in `config.yml`. See the [`geerlingguy.nodejs` Ansible role's README](https://github.com/geerlingguy/ansible-role-nodejs#readme) for all the currently-available versions for your OS. ```yaml nodejs_version: "0.12" diff --git a/docs/extras/syncing-folders.md b/docs/extras/syncing-folders.md index b1581fad3..90a31d40e 100644 --- a/docs/extras/syncing-folders.md +++ b/docs/extras/syncing-folders.md @@ -40,7 +40,7 @@ options_override: Using different synced folder mechanisms can have a dramatic impact on your Drupal site's performance. Please read through the following blog posts for a thorough overview of synced folder performance: - [Comparing filesystem performance in Virtual Machines](http://mitchellh.com/comparing-filesystem-performance-in-virtual-machines) - - [NFS, rsync, and shared folder performance in Vagrant VMs](http://www.midwesternmac.com/blogs/jeff-geerling/nfs-rsync-and-shared-folder) + - [NFS, rsync, and shared folder performance in Vagrant VMs](http://www.jeffgeerling.com/blogs/jeff-geerling/nfs-rsync-and-shared-folder) Generally speaking: diff --git a/docs/other/cloning-with-newd.md b/docs/other/cloning-with-newd.md index 0a01a6e48..286b8f835 100644 --- a/docs/other/cloning-with-newd.md +++ b/docs/other/cloning-with-newd.md @@ -10,6 +10,6 @@ $ newd 7 test-fieldformatter $ newd 8 drupal8test ``` -The source code for this new bash function (you could add it to your own `.bash_profile` or `.profile`) is located here: https://gist.github.com/rgoodie/9966f30b404a4daa59e1 +The source code for this new bash function (you could add it to your own `.bash_profile` or `.profile`) is located [in this gist](https://gist.github.com/rgoodie/9966f30b404a4daa59e1). Do you have your own wrapper script or other helpers to help you manage instances of Drupal VM? Please share it on this page! \ No newline at end of file diff --git a/docs/other/linux.md b/docs/other/linux.md index 3d83c6c15..843dc975a 100644 --- a/docs/other/linux.md +++ b/docs/other/linux.md @@ -57,7 +57,7 @@ If you get this message, then it's likely that either NFS isn't running correctl 1. On Ubuntu, if you get a message like `It appears your machine doesn't support NFS`, run `sudo apt-get install -y nfs-server`. 2. Install the `vagrant-vbguest` plugin, which will make sure you are running the latest version of the VirualBox Guest Additions inside the VM (this can solve many different problems!). - 3. Make sure the `vboxnet` interfaces are not being blocked by your system firewall. For Fedora (and many flavors of Linux), check out this guide for more: [Get Vagrant's NFS working under Fedora 20](http://blog.bak1an.site/blog/2014/03/23/fedora-vagrant-nfs/). + 3. Make sure the `vboxnet` interfaces are not being blocked by your system firewall. For Fedora (and many flavors of Linux), check out this guide for more: [Get Vagrant's NFS working under Fedora 20](https://web.archive.org/web/20150706105420/http://blog.bak1an.so/blog/2014/03/23/fedora-vagrant-nfs/). 4. Add `mount_options: ['vers=3']` to your synced folder definition in config.yml after the other options like `local_path`, `destination`, and `type`. After attempting any of the above fixes, run `vagrant reload --provision` to restart the VM and attempt mounting the synced folder again, or `vagrant destroy -f && vagrant up` to rebuild the VM from scratch. diff --git a/docs/other/php-7.md b/docs/other/php-7.md index 6e5f4a0b8..811f5d429 100644 --- a/docs/other/php-7.md +++ b/docs/other/php-7.md @@ -34,6 +34,6 @@ You can also build from source using the same/included `geerlingguy.php` Ansible Remi's RPM repository is included with Drupal VM, and you can make the following changes to use it to install PHP 7: - 1. Make sure you've followed the directions for switching to CentOS 7 in the [use a different base OS](https://github.com/geerlingguy/drupal-vm/wiki/Using-Different-Base-OSes) guide. + 1. Make sure you've followed the directions for switching to CentOS 7 in the [use a different base OS](base-os.md) guide. 2. Change `php_version` inside `config.yml` to `"7.0"`. 3. Comment out `xhprof`, `xdebug`, `redis` and `memcached` from the `installed_extras` list, as these extensions are not yet supported for PHP 7 (as of late 2015). diff --git a/docs/other/webservers.md b/docs/other/webservers.md index 1609cbbf4..3011c021d 100644 --- a/docs/other/webservers.md +++ b/docs/other/webservers.md @@ -8,10 +8,10 @@ Because the webservers are configured somewhat differently, there are a few thin You have complete control over all aspects of Apache VirtualHosts using the `apache_vhosts` configuration. A few simple examples are shown in `example.config.yml`, but this configuration can be much more complex. -See the examples included in the [`geerlingguy.apache`](https://github.com/geerlingguy/ansible-role-apache) Ansible role's README for more info, as well as many other variables you can override to configure Apache exactly how you like it. +See the examples included in the [`geerlingguy.apache` Ansible role's README](https://github.com/geerlingguy/ansible-role-apache#readme) for more info, as well as many other variables you can override to configure Apache exactly how you like it. ## Using Nginx Because Nginx server directives behave a little differently than Apache's VirtualHosts, Drupal VM includes a custom Drupal-optimized Nginx server block configuration, and you can control all the servers ('virtual hosts') Nginx will run using the `nginx_hosts` configuration. A few simple examples are shown in `example.config.yml`, but you have some extra flexibility if you need it. See the `nginx-vhost.conf.j2` template for more information. -Also, see the examples included in the [`geerlingguy.nginx`](https://github.com/geerlingguy/ansible-role-nginx) Ansible role's README for more info, as well as many other variables you can override to configure Nginx exactly how you like it. +Also, see the examples included in the [`geerlingguy.nginx` Ansible role's README](https://github.com/geerlingguy/ansible-role-nginx#readme) for more info, as well as many other variables you can override to configure Nginx exactly how you like it. From cf1655cb7f9100b24f0f545f9e221a355fe15de3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oskar=20Sch=C3=B6ldstr=C3=B6m?= Date: Mon, 25 Jan 2016 16:47:27 -0500 Subject: [PATCH 0113/1273] docs: mention the bundled post provisioning script for configuring solr --- docs/extras/solr.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/docs/extras/solr.md b/docs/extras/solr.md index 3c4bf0598..0fd47a8ea 100644 --- a/docs/extras/solr.md +++ b/docs/extras/solr.md @@ -10,7 +10,12 @@ This will connect to the default search core (`collection1`) set up by Solr. If ## Configuring the Solr search core for Drupal -Before Drupal content can be indexed correctly into Apache Solr, you will need to copy the Drupal Apache Solr Search or Search API Apache Solr configuration into place, and restart Apache Solr. This process will soon be automated, but for now, please perform the steps outlined in step 5 in this blog post (which should work with Drupal VM): [Solr for Drupal Developers, Part 3: Testing Solr locally](http://www.midwesternmac.com/blogs/jeff-geerling/solr-drupal-developers-part-3). +Before Drupal content can be indexed correctly into Apache Solr, you will need to copy the Drupal Apache Solr Search or Search API Apache Solr configuration into place, and restart Apache Solr. Drupal VM comes with an example post provision script for automating this. Simply add it to `post_provision_scripts`: + +```yaml +post_provision_scripts: + - "../examples/scripts/configure-solr.sh" +``` ## Extra Solr configuration From 51d20900335f223a7473fe00ffa5c02570031464 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oskar=20Sch=C3=B6ldstr=C3=B6m?= Date: Mon, 25 Jan 2016 16:49:51 -0500 Subject: [PATCH 0114/1273] docs: remove mention of long paths issue Vagrant 1.8 is already a requirement --- docs/other/windows.md | 4 ---- 1 file changed, 4 deletions(-) diff --git a/docs/other/windows.md b/docs/other/windows.md index 25d2dc446..ee4b4d2ac 100644 --- a/docs/other/windows.md +++ b/docs/other/windows.md @@ -29,10 +29,6 @@ You should probably disable Git's `fileMode` option inside the VM and on your ho git config core.fileMode false -### Long Paths - -Creating long paths inside a shared folder will fail if the length exceeds 260 characters. This usually happens when using npm. This should be solved in Vagrant 1.7.3, but if you're running an older version, you can manually make the changes here: https://github.com/mitchellh/vagrant/pull/5495/files - ### NFS You can use the [vagrant-winnfsd](https://github.com/GM-Alex/vagrant-winnfsd) plugin to get NFS support on windows. Be aware that there are multiple issues logged against both the plugin and the winnfsd project, so no guarantees. From 1486bd7f23f88fe6c8b0b20c4b232947824aef4a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oskar=20Sch=C3=B6ldstr=C3=B6m?= Date: Tue, 26 Jan 2016 10:10:28 -0500 Subject: [PATCH 0115/1273] Bring README.md up to date. Closes #357 [ci skip] --- README.md | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index af649be00..38f0434a4 100644 --- a/README.md +++ b/README.md @@ -52,16 +52,16 @@ If you want to switch from Drupal 8 (default) to Drupal 7 or 6 on the initial in This Quick Start Guide will help you quickly build a Drupal 8 site on the Drupal VM using the included example Drush make file. You can also use the Drupal VM with a [Local Drupal codebase](http://docs.drupalvm.com/en/latest/deployment/local-codebase/) or even a [Drupal multisite installation](http://docs.drupalvm.com/en/latest/deployment/multisite/). -### 1 - Install dependencies (VirtualBox and Vagrant) +### 1 - Install dependencies (Vagrant) - 1. Download and install [VirtualBox](https://www.virtualbox.org/wiki/Downloads) (Drupal VM also works with Parallels or VMware, if you have the [Vagrant VMware integration plugin](http://www.vagrantup.com/vmware)). - 2. Download and install [Vagrant](http://www.vagrantup.com/downloads.html). +Download and install [Vagrant](https://www.vagrantup.com/downloads.html). +- Vagrant will automatically install [VirtualBox](https://www.virtualbox.org/wiki/Downloads) if no providers are available (Drupal VM also works with Parallels or VMware, if you have the [Vagrant VMware integration plugin](http://www.vagrantup.com/vmware)). Note for Faster Provisioning (Mac/Linux only): *[Install Ansible](http://docs.ansible.com/intro_installation.html) on your host machine, so Drupal VM can run the provisioning steps locally instead of inside the VM.* Note for Linux users: *If NFS is not already installed on your host, you will need to install it to use the default NFS synced folder configuration. See guides for [Debian/Ubuntu](https://www.digitalocean.com/community/tutorials/how-to-set-up-an-nfs-mount-on-ubuntu-14-04), [Arch](https://wiki.archlinux.org/index.php/NFS#Installation), and [RHEL/CentOS](https://www.digitalocean.com/community/tutorials/how-to-set-up-an-nfs-mount-on-centos-6).* -Note on versions: *Please make sure you're running the latest stable version of Vagrant, VirtualBox, and Ansible, as the current version of Drupal VM is tested with the latest releases. As of August 2015: Vagrant 1.8.0, VirtualBox 5.0.12, and Ansible 2.0.0.* +Note on versions: *Please make sure you're running the latest stable version of Vagrant, VirtualBox, and Ansible, as the current version of Drupal VM is tested with the latest releases. As of February 2016: Vagrant 1.8.2, VirtualBox 5.0.14, and Ansible 2.0.0.* ### 2 - Build the Virtual Machine @@ -89,11 +89,15 @@ By default, this VM includes the extras listed in the `config.yml` option `insta installed_extras: - adminer + - drupalconsole - mailhog - memcached + # - nodejs - pimpmylog - # - solr + # - redis + # - ruby # - selenium + # - solr - varnish - xdebug - xhprof @@ -118,4 +122,4 @@ This project is licensed under the MIT open source license. ## About the Author -[Jeff Geerling](http://jeffgeerling.com/), owner of [Midwestern Mac, LLC](http://www.midwesternmac.com/), created this project in 2014 so he could accelerate his Drupal core and contrib development workflow. This project, and others like it, are also featured as examples in Jeff's book, [Ansible for DevOps](http://www.ansiblefordevops.com/). +[Jeff Geerling](http://www.jeffgeerling.com/), owner of [Midwestern Mac, LLC](http://www.midwesternmac.com/), created this project in 2014 so he could accelerate his Drupal core and contrib development workflow. This project, and others like it, are also featured as examples in Jeff's book, [Ansible for DevOps](http://www.ansiblefordevops.com/). From 4bc7309cde839d8dd1d965da2b59a62583d511d9 Mon Sep 17 00:00:00 2001 From: Jeff Geerling Date: Tue, 26 Jan 2016 14:00:25 -0600 Subject: [PATCH 0116/1273] Fixes #381: Update xhprof docs to mention disabling xdebug. --- docs/extras/xhprof.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/extras/xhprof.md b/docs/extras/xhprof.md index 19b43a882..74d724881 100644 --- a/docs/extras/xhprof.md +++ b/docs/extras/xhprof.md @@ -1,5 +1,7 @@ As a prerequisite, make sure you have `xhprof` in the `installed_extras` list inside `config.yml` (So the PHP XHProf extension is installed on Drupal VM). +**Note**: You should disable `xdebug` when enabling/using XHProf, because it is known to have issues running alongside XHProf, and makes test results less reliable and slower than they should be. + ## XHProf module The easiest way to use XHProf to profile your PHP code on a Drupal site is to install the [XHProf](https://www.drupal.org/project/xhprof) module, then in XHProf's configuration (at `/admin/config/development/xhprof`), check the 'Enable profiling of page views and drush requests' checkbox. @@ -11,4 +13,4 @@ The XHProf module doesn't yet include support for callgraphs, but there's an iss The Devel module also *used* to provide XHProf configuration, and setting the options below would allow Devel's XHProf integration to work correctly with Drupal VM's XHProf installation: - **xhprof directory**: `/usr/share/php` - - **XHProf URL**: `http://xhprof.drupalvm.dev/` (assuming this domain is configured in `apache_vhosts` inside `config.yml`) + - **XHProf URL**: `http://xhprof.drupalvm.dev` (assuming this domain is configured in `apache_vhosts` inside `config.yml`) From c1fa34e1904cf7051d144cf871c88b7305539443 Mon Sep 17 00:00:00 2001 From: Jeff Geerling Date: Tue, 26 Jan 2016 19:10:30 -0600 Subject: [PATCH 0117/1273] Fixes #394: Fix paths for special domains. --- example.config.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/example.config.yml b/example.config.yml index 67bd26b37..97ec3dda2 100644 --- a/example.config.yml +++ b/example.config.yml @@ -85,17 +85,17 @@ apache_vhosts: - servername: "adminer.drupalvm.dev" documentroot: "/opt/adminer" extra_parameters: | - ProxyPassMatch ^/(.*\.php(/.*)?)$ "unix:/var/run/php5-fpm.sock|fcgi://127.0.0.1:9000/opt/adminer" + ProxyPassMatch ^/(.*\.php(/.*)?)$ "fcgi://127.0.0.1:9000/opt/adminer" - servername: "xhprof.drupalvm.dev" documentroot: "/usr/share/php/xhprof_html" extra_parameters: | - ProxyPassMatch ^/(.*\.php(/.*)?)$ "unix:/var/run/php5-fpm.sock|fcgi://127.0.0.1:9000/usr/share/php/xhprof_html" + ProxyPassMatch ^/(.*\.php(/.*)?)$ "fcgi://127.0.0.1:9000/usr/share/php/xhprof_html" - servername: "pimpmylog.drupalvm.dev" documentroot: "/usr/share/php/pimpmylog" extra_parameters: | - ProxyPassMatch ^/(.*\.php(/.*)?)$ "unix:/var/run/php5-fpm.sock|fcgi://127.0.0.1:9000/usr/share/php/pimpmylog" + ProxyPassMatch ^/(.*\.php(/.*)?)$ "fcgi://127.0.0.1:9000/usr/share/php/pimpmylog" apache_remove_default_vhost: true apache_mods_enabled: From 8a05b75dcf51ebe8db1910718f1252f89f024a32 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oskar=20Sch=C3=B6ldstr=C3=B6m?= Date: Thu, 28 Jan 2016 18:31:38 -0500 Subject: [PATCH 0118/1273] add support for sourcing a local Vagrantfile --- .gitignore | 1 + Vagrantfile | 5 +++++ docs/other/local-vagrantfile.md | 20 ++++++++++++++++++++ mkdocs.yml | 1 + 4 files changed, 27 insertions(+) create mode 100644 docs/other/local-vagrantfile.md diff --git a/.gitignore b/.gitignore index 9b55c8c6e..b48a04283 100644 --- a/.gitignore +++ b/.gitignore @@ -6,6 +6,7 @@ vagrant_ansible_inventory_default config.yml drupal.make.yml +Vagrantfile.local examples/prod/inventory scripts/ roles/ diff --git a/Vagrantfile b/Vagrantfile index 3e8fcf875..d10077d71 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -126,4 +126,9 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| # Set the name of the VM. See: http://stackoverflow.com/a/17864388/100134 config.vm.define vconfig['vagrant_machine_name'] do |d| end + + # Allow an untracked Vagrantfile to modify the configurations + if File.exist?('Vagrantfile.local') + eval File.read 'Vagrantfile.local' + end end diff --git a/docs/other/local-vagrantfile.md b/docs/other/local-vagrantfile.md new file mode 100644 index 000000000..bc5940fb8 --- /dev/null +++ b/docs/other/local-vagrantfile.md @@ -0,0 +1,20 @@ +Out of the box Drupal VM supports having VirtualBox, Parallels as well as VMware as a provider. Besides these there are multitude of others available (for example `vagrant-aws`, `vagrant-digitalocean`). + +If you want to use an unsupported provider, or otherwise modify the vagrant configuration in a way that is not exposed by Drupal VM, you can create a `Vagrantfile.local` in the root directory of this project. + +The file will be sourced at the end of the `Vagrant.configure` block so you will have access to Vagrant's `config.vm` object as well as the contents of the `config.yml` file within the `vconfig` hash. + +To add a configuration just create a `Vagrantfile.local` in the root like so: + +```ruby +config.vm.provider :virtualbox do |v| + # Enable GUI mode instead of running a headless machine. + v.gui = true + + # Reduce disk usage of multiple boxes by sharing a master VM. + v.linked_clone = true + + # Cap the host CPU execution at 50% usage. + v.customize ["modifyvm", :id, "--cpuexecutioncap", "50"] +end +``` diff --git a/mkdocs.yml b/mkdocs.yml index dc7253602..285442986 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -32,6 +32,7 @@ pages: - Other Information: - 'Using Different Base OSes': 'other/base-os.md' - 'Using Different Webservers': 'other/webservers.md' + - 'Using a local Vagrantfile': 'other/local-vagrantfile.md' - 'PHP 7 on Drupal VM': 'other/php-7.md' - 'Networking Notes': 'other/networking.md' - 'Drupal 6 Notes': 'other/drupal-6.md' From 972e60f56066c8df1c237b50e27978beff0a1cfd Mon Sep 17 00:00:00 2001 From: Tyler Marshall Date: Thu, 28 Jan 2016 19:19:21 -0500 Subject: [PATCH 0119/1273] docs: add example of using vagrant-aws provisioner --- docs/other/local-vagrantfile.md | 35 +++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/docs/other/local-vagrantfile.md b/docs/other/local-vagrantfile.md index bc5940fb8..210558667 100644 --- a/docs/other/local-vagrantfile.md +++ b/docs/other/local-vagrantfile.md @@ -18,3 +18,38 @@ config.vm.provider :virtualbox do |v| v.customize ["modifyvm", :id, "--cpuexecutioncap", "50"] end ``` + +## Example: Using the `vagrant-aws` provider + +Add the following variables to your `config.yml`. + +```yaml +aws_keypair_name: 'keypair' +aws_ami: 'ami-7747d01e' +aws_tags_name: 'Drupal VM' +aws_ssh_username: 'ubuntu' +aws_ssh_private_key: '~/.ssh/aws.pem' +``` + +Create a `Vagrantfile.local` in the root directory of your project. + +```ruby +config.vm.provider :aws do |aws, override| + override.nfs.functional = false + + aws.access_key_id = ENV['AWS_ACCESS_KEY_ID'] + aws.secret_access_key = ENV['AWS_SECRET_ACCESS_KEY'] + aws.keypair_name = vconfig['aws_keypair_name'] + aws.tags['Name'] = vconfig['aws_tags_name'] + aws.ami = vconfig['aws_ami'] + + override.ssh.username = vconfig['aws_ssh_username'] + override.ssh.private_key_path = vconfig['aws_ssh_private_key'] +end +``` + +Add the `AWS_ACCESS_KEY_ID` and the `AWS_SECRET_ACCESS_KEY` environment variables to your shell. + +Then run `vagrant up --provider=aws` to provision the instance. + +_For additional configuring options read the [Vagrant AWS Provider's README](https://github.com/mitchellh/vagrant-aws#readme)_ From d455f20552cf5395d14643d81cd890fd23c04889 Mon Sep 17 00:00:00 2001 From: Jeff Geerling Date: Thu, 28 Jan 2016 21:50:57 -0600 Subject: [PATCH 0120/1273] Fixes #400: Use Vagrant 1.8 linked clonse feature for VirtualBox. --- Vagrantfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Vagrantfile b/Vagrantfile index d10077d71..f9f77e16a 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -108,6 +108,7 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| # VirtualBox. config.vm.provider :virtualbox do |v| + v.linked_clone = true if Vagrant::VERSION =~ /^1.8/ v.name = vconfig['vagrant_hostname'] v.memory = vconfig['vagrant_memory'] v.cpus = vconfig['vagrant_cpus'] From fb8a616935c33380d9085b513cb3cfafe07b0797 Mon Sep 17 00:00:00 2001 From: Jeff Geerling Date: Thu, 28 Jan 2016 22:34:43 -0600 Subject: [PATCH 0121/1273] Helps with #379: Add proxy and proxy_fcgi modules to example config. --- example.config.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/example.config.yml b/example.config.yml index 97ec3dda2..3072d807f 100644 --- a/example.config.yml +++ b/example.config.yml @@ -102,6 +102,8 @@ apache_mods_enabled: - expires.load - ssl.load - rewrite.load + - proxy.load + - proxy_fcgi.load # Nginx hosts. Each site will get a server entry using the configuration defined # here. Set the 'is_php' property for document roots that contain PHP apps like From 4b04538a2dd412cecd4d62ca6e298dd6fba4c767 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oskar=20Sch=C3=B6ldstr=C3=B6m?= Date: Fri, 29 Jan 2016 18:17:51 -0500 Subject: [PATCH 0122/1273] Helps with #379: Set drush_version explicitly to a string --- example.config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/example.config.yml b/example.config.yml index 3072d807f..0a0f1e0b0 100644 --- a/example.config.yml +++ b/example.config.yml @@ -172,7 +172,7 @@ ruby_install_gems: [] # You can configure almost anything else on the server in the rest of this file. extra_security_enabled: false -drush_version: master +drush_version: "master" drush_keep_updated: true drush_composer_cli_options: "--prefer-dist --no-interaction" From e5058d03a1684ce59a6b84852856ca84e9c6c093 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oskar=20Sch=C3=B6ldstr=C3=B6m?= Date: Sun, 31 Jan 2016 12:15:13 -0500 Subject: [PATCH 0123/1273] replace jinja variables in config --- Vagrantfile | 35 +++++++++++++++++++++++++++-------- example.config.yml | 14 +++++++------- 2 files changed, 34 insertions(+), 15 deletions(-) diff --git a/Vagrantfile b/Vagrantfile index f9f77e16a..0a689f286 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -14,6 +14,16 @@ def which(cmd) return nil end +def walk(obj, &fn) + if obj.is_a?(Array) + obj.map { |value| walk(value, &fn) } + elsif obj.is_a?(Hash) + obj.each_pair { |key, value| obj[key] = walk(value, &fn) } + else + obj = fn.call(obj) + end +end + # Use config.yml for basic VM configuration. require 'yaml' dir = File.dirname(File.expand_path(__FILE__)) @@ -22,6 +32,14 @@ if !File.exist?("#{dir}/config.yml") end vconfig = YAML::load_file("#{dir}/config.yml") +# Replace jinja variables in config. +vconfig = walk(vconfig) do |value| + while value.is_a?(String) && value.match(/{{ .* }}/) + value = value.gsub(/{{ (.*?) }}/) { |match| match = vconfig[$1] } + end + value +end + Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| # Networking configuration. @@ -47,21 +65,22 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| # If hostsupdater plugin is installed, add all server names as aliases. if Vagrant.has_plugin?("vagrant-hostsupdater") - config.hostsupdater.aliases = [] - # Add all hosts that aren't defined as Ansible vars. + aliases = [] + blacklist = [config.vm.hostname, vconfig['vagrant_ip']] if vconfig['drupalvm_webserver'] == "apache" - for host in vconfig['apache_vhosts'] - unless host['servername'].include? "{{" - config.hostsupdater.aliases.push(host['servername']) + vconfig['apache_vhosts'].each do |host| + unless blacklist.include?(host['servername']) + aliases.push(host['servername']) end end else - for host in vconfig['nginx_hosts'] - unless host['server_name'].include? "{{" - config.hostsupdater.aliases.push(host['server_name']) + vconfig['nginx_hosts'].each do |host| + unless blacklist.include?(host['server_name']) + aliases.push(host['server_name']) end end end + config.hostsupdater.aliases = aliases.uniq end # Synced folders. diff --git a/example.config.yml b/example.config.yml index 0a0f1e0b0..b801b0566 100644 --- a/example.config.yml +++ b/example.config.yml @@ -47,7 +47,7 @@ install_site: true # is 'true'). drupal_major_version: 8 drupal_core_path: "/var/www/drupalvm/drupal" -drupal_domain: "drupalvm.dev" +drupal_domain: "{{ vagrant_machine_name }}" drupal_site_name: "Drupal" drupal_install_profile: standard drupal_enable_modules: [ 'devel' ] @@ -82,17 +82,17 @@ apache_vhosts: extra_parameters: | ProxyPassMatch ^/(.*\.php(/.*)?)$ "fcgi://127.0.0.1:9000{{ drupal_core_path }}" - - servername: "adminer.drupalvm.dev" + - servername: "adminer.{{ vagrant_machine_name }}" documentroot: "/opt/adminer" extra_parameters: | ProxyPassMatch ^/(.*\.php(/.*)?)$ "fcgi://127.0.0.1:9000/opt/adminer" - - servername: "xhprof.drupalvm.dev" + - servername: "xhprof.{{ vagrant_machine_name }}" documentroot: "/usr/share/php/xhprof_html" extra_parameters: | ProxyPassMatch ^/(.*\.php(/.*)?)$ "fcgi://127.0.0.1:9000/usr/share/php/xhprof_html" - - servername: "pimpmylog.drupalvm.dev" + - servername: "pimpmylog.{{ vagrant_machine_name }}" documentroot: "/usr/share/php/pimpmylog" extra_parameters: | ProxyPassMatch ^/(.*\.php(/.*)?)$ "fcgi://127.0.0.1:9000/usr/share/php/pimpmylog" @@ -113,15 +113,15 @@ nginx_hosts: root: "{{ drupal_core_path }}" is_php: true - - server_name: "adminer.drupalvm.dev" + - server_name: "adminer.{{ vagrant_machine_name }}" root: "/opt/adminer" is_php: true - - server_name: "xhprof.drupalvm.dev" + - server_name: "xhprof.{{ vagrant_machine_name }}" root: "/usr/share/php/xhprof_html" is_php: true - - server_name: "pimpmylog.drupalvm.dev" + - server_name: "pimpmylog.{{ vagrant_machine_name }}" root: "/usr/share/php/pimpmylog" is_php: true From eddeb9f34c81ca82a40c4edb40aa92a959b560af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oskar=20Sch=C3=B6ldstr=C3=B6m?= Date: Sun, 31 Jan 2016 12:15:38 -0500 Subject: [PATCH 0124/1273] add apache serveraliases to hostsupdater --- Vagrantfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Vagrantfile b/Vagrantfile index 0a689f286..2a1995986 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -72,6 +72,7 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| unless blacklist.include?(host['servername']) aliases.push(host['servername']) end + aliases.concat(host['serveralias'].split()) if host['serveralias'] end else vconfig['nginx_hosts'].each do |host| From 19ad2df8f27a26e6a8ca4da964eec48c21c7451c Mon Sep 17 00:00:00 2001 From: Aleksey Tkachenko Date: Mon, 1 Feb 2016 18:20:47 +0100 Subject: [PATCH 0125/1273] Updates documentation about PHP 7 configuration --- docs/other/php-7.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/other/php-7.md b/docs/other/php-7.md index 811f5d429..bc1b80022 100644 --- a/docs/other/php-7.md +++ b/docs/other/php-7.md @@ -22,6 +22,7 @@ php_packages: - php7.0-opcache php_mysql_package: php7.0-mysql php_fpm_daemon: php7.0-fpm +php_fpm_pool_conf_path: "/etc/php/7.0/fpm/pool.d/www.conf" ``` Also, comment out `xhprof`, `xdebug`, `redis` and `memcached` from the `installed_extras` list, as these extensions are not yet supported for PHP 7 (as of late 2015). From 42d554d9c2287a5efe76636ec890e701c4744159 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oskar=20Sch=C3=B6ldstr=C3=B6m?= Date: Mon, 1 Feb 2016 13:08:33 -0500 Subject: [PATCH 0126/1273] use variables for docroots --- docs/other/base-os.md | 4 ---- example.config.yml | 18 +++++++++--------- provisioning/tasks/init-debian.yml | 5 +++++ provisioning/tasks/init-redhat.yml | 5 +++++ 4 files changed, 19 insertions(+), 13 deletions(-) diff --git a/docs/other/base-os.md b/docs/other/base-os.md index 6646f1140..623888819 100644 --- a/docs/other/base-os.md +++ b/docs/other/base-os.md @@ -27,8 +27,6 @@ mysql_syslog_tag: mariadb mysql_pid_file: /var/run/mariadb/mariadb.pid ``` -**XHProf**: XHProf is installed in a different directory for RedHat/CentOS (as opposed to Debian/Ubuntu), you will need to update the `"xhprof.drupalvm.dev"` vhost to point to the `documentroot` `"/usr/share/pear/xhprof_html"`. - ## RedHat Enterprise Linux / CentOS 6 **Apache without FastCGI**: If you want to use Apache with CentOS 6 on Drupal VM, you will need to modify the syntax of your `apache_vhosts` and remove the `ProxyPassMatch` parameters from each one. Alternatively, you can use Nginx with the default configuration by setting `drupalvm_webserver: nginx` inside `config.yml`. @@ -38,5 +36,3 @@ mysql_pid_file: /var/run/mariadb/mariadb.pid ```yaml php_opcache_enabled_in_ini: false ``` - -**XHProf**: XHProf is installed in a different directory for RedHat/CentOS (as opposed to Debian/Ubuntu), you will need to update the `"xhprof.drupalvm.dev"` vhost to point to the `documentroot` `"/usr/share/pear/xhprof_html"`. \ No newline at end of file diff --git a/example.config.yml b/example.config.yml index b801b0566..a43eb711d 100644 --- a/example.config.yml +++ b/example.config.yml @@ -83,19 +83,19 @@ apache_vhosts: ProxyPassMatch ^/(.*\.php(/.*)?)$ "fcgi://127.0.0.1:9000{{ drupal_core_path }}" - servername: "adminer.{{ vagrant_machine_name }}" - documentroot: "/opt/adminer" + documentroot: "{{ adminer_install_dir }}" extra_parameters: | - ProxyPassMatch ^/(.*\.php(/.*)?)$ "fcgi://127.0.0.1:9000/opt/adminer" + ProxyPassMatch ^/(.*\.php(/.*)?)$ "fcgi://127.0.0.1:9000{{ adminer_install_dir }}" - servername: "xhprof.{{ vagrant_machine_name }}" - documentroot: "/usr/share/php/xhprof_html" + documentroot: "{{ php_xhprof_html_dir }}" extra_parameters: | - ProxyPassMatch ^/(.*\.php(/.*)?)$ "fcgi://127.0.0.1:9000/usr/share/php/xhprof_html" + ProxyPassMatch ^/(.*\.php(/.*)?)$ "fcgi://127.0.0.1:9000{{ php_xhprof_html_dir }}" - servername: "pimpmylog.{{ vagrant_machine_name }}" - documentroot: "/usr/share/php/pimpmylog" + documentroot: "{{ pimpmylog_install_dir }}" extra_parameters: | - ProxyPassMatch ^/(.*\.php(/.*)?)$ "fcgi://127.0.0.1:9000/usr/share/php/pimpmylog" + ProxyPassMatch ^/(.*\.php(/.*)?)$ "fcgi://127.0.0.1:9000{{ pimpmylog_install_dir }}" apache_remove_default_vhost: true apache_mods_enabled: @@ -114,15 +114,15 @@ nginx_hosts: is_php: true - server_name: "adminer.{{ vagrant_machine_name }}" - root: "/opt/adminer" + root: "{{ adminer_install_dir }}" is_php: true - server_name: "xhprof.{{ vagrant_machine_name }}" - root: "/usr/share/php/xhprof_html" + root: "{{ php_xhprof_html_dir }}" is_php: true - server_name: "pimpmylog.{{ vagrant_machine_name }}" - root: "/usr/share/php/pimpmylog" + root: "{{ pimpmylog_install_dir }}" is_php: true nginx_remove_default_vhost: true diff --git a/provisioning/tasks/init-debian.yml b/provisioning/tasks/init-debian.yml index 7a848f3a3..14735b49d 100644 --- a/provisioning/tasks/init-debian.yml +++ b/provisioning/tasks/init-debian.yml @@ -24,3 +24,8 @@ - name: Add repository for PHP 7.0. apt_repository: repo='ppa:ondrej/php-7.0' when: php_version == "7.0" + +- name: Define php_xhprof_html_dir. + set_fact: + php_xhprof_html_dir: "/usr/share/php/xhprof_html" + when: php_xhprof_html_dir is not defined diff --git a/provisioning/tasks/init-redhat.yml b/provisioning/tasks/init-redhat.yml index 5e3a72533..2c45a511b 100644 --- a/provisioning/tasks/init-redhat.yml +++ b/provisioning/tasks/init-redhat.yml @@ -20,3 +20,8 @@ - name: Enable remi repo for PHP 7.0. set_fact: php_enablerepo="remi,remi-php70" when: php_version == "7.0" + +- name: Define php_xhprof_html_dir. + set_fact: + php_xhprof_html_dir: "/usr/share/pear/xhprof_html" + when: php_xhprof_html_dir is not defined From edb628eb40e92d014878b9c2065ee0989909f3b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oskar=20Sch=C3=B6ldstr=C3=B6m?= Date: Sat, 30 Jan 2016 14:52:54 -0500 Subject: [PATCH 0127/1273] Issue #300: Fix drush aliases not scaffolded for nginx hosts --- .../drupalvm-local.aliases.drushrc.php.j2 | 20 ++++++++++++---- .../templates/drupalvm.aliases.drushrc.php.j2 | 23 +++++++++++++------ 2 files changed, 31 insertions(+), 12 deletions(-) diff --git a/provisioning/templates/drupalvm-local.aliases.drushrc.php.j2 b/provisioning/templates/drupalvm-local.aliases.drushrc.php.j2 index 20c40ed63..45d94ec80 100644 --- a/provisioning/templates/drupalvm-local.aliases.drushrc.php.j2 +++ b/provisioning/templates/drupalvm-local.aliases.drushrc.php.j2 @@ -6,10 +6,20 @@ * @see example.aliases.drushrc.php. */ -{% for vhost in apache_vhosts %} -$aliases['{{ vhost.servername }}'] = array( - 'uri' => '{{ vhost.servername }}', - 'root' => '{{ vhost.documentroot }}', +{% macro alias(host, root) %} +$aliases['{{ host }}'] = array( + 'uri' => '{{ host }}', + 'root' => '{{ root }}', ); -{% endfor %} +{% endmacro %} + +{%- if drupalvm_webserver == 'apache' -%} + {%- for vhost in apache_vhosts -%} + {{ alias(vhost.servername, vhost.documentroot) }} + {%- endfor -%} +{%- elif drupalvm_webserver == 'nginx' -%} + {%- for host in nginx_hosts -%} + {{ alias(host.server_name, host.root) }} + {%- endfor -%} +{%- endif -%} diff --git a/provisioning/templates/drupalvm.aliases.drushrc.php.j2 b/provisioning/templates/drupalvm.aliases.drushrc.php.j2 index 9f1138518..3e02de98d 100644 --- a/provisioning/templates/drupalvm.aliases.drushrc.php.j2 +++ b/provisioning/templates/drupalvm.aliases.drushrc.php.j2 @@ -5,14 +5,23 @@ * * @see example.aliases.drushrc.php. */ - -{% for vhost in apache_vhosts %} -$aliases['{{ vhost.servername }}'] = array( - 'uri' => '{{ vhost.servername }}', - 'root' => '{{ vhost.documentroot }}', - 'remote-host' => '{{ vhost.servername }}', +{% macro alias(host, root) %} +$aliases['{{ host }}'] = array( + 'uri' => '{{ host }}', + 'root' => '{{ root }}', + 'remote-host' => '{{ host }}', 'remote-user' => 'vagrant', 'ssh-options' => '-o PasswordAuthentication=no -i ~/.vagrant.d/insecure_private_key', ); -{% endfor %} +{% endmacro %} + +{%- if drupalvm_webserver == 'apache' -%} + {%- for vhost in apache_vhosts -%} + {{ alias(vhost.servername, vhost.documentroot) }} + {%- endfor -%} +{%- elif drupalvm_webserver == 'nginx' -%} + {%- for host in nginx_hosts -%} + {{ alias(host.server_name, host.root) }} + {%- endfor -%} +{%- endif -%} From d3c993363fb76a80f69bd49650fba0b5fd84b1eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oskar=20Sch=C3=B6ldstr=C3=B6m?= Date: Sat, 30 Jan 2016 14:57:25 -0500 Subject: [PATCH 0128/1273] Skip drush aliases for development tool hosts --- .../templates/drupalvm-local.aliases.drushrc.php.j2 | 10 ++++++++-- .../templates/drupalvm.aliases.drushrc.php.j2 | 13 ++++++++++--- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/provisioning/templates/drupalvm-local.aliases.drushrc.php.j2 b/provisioning/templates/drupalvm-local.aliases.drushrc.php.j2 index 45d94ec80..3c690f17a 100644 --- a/provisioning/templates/drupalvm-local.aliases.drushrc.php.j2 +++ b/provisioning/templates/drupalvm-local.aliases.drushrc.php.j2 @@ -6,6 +6,8 @@ * @see example.aliases.drushrc.php. */ +{% set devtool_docroots = [adminer_install_dir, pimpmylog_install_dir, php_xhprof_html_dir] %} + {% macro alias(host, root) %} $aliases['{{ host }}'] = array( 'uri' => '{{ host }}', @@ -16,10 +18,14 @@ $aliases['{{ host }}'] = array( {%- if drupalvm_webserver == 'apache' -%} {%- for vhost in apache_vhosts -%} - {{ alias(vhost.servername, vhost.documentroot) }} + {%- if vhost.documentroot not in devtool_docroots -%} + {{ alias(vhost.servername, vhost.documentroot) }} + {%- endif -%} {%- endfor -%} {%- elif drupalvm_webserver == 'nginx' -%} {%- for host in nginx_hosts -%} - {{ alias(host.server_name, host.root) }} + {%- if host.root not in devtool_docroots -%} + {{ alias(host.server_name, host.root) }} + {%- endif -%} {%- endfor -%} {%- endif -%} diff --git a/provisioning/templates/drupalvm.aliases.drushrc.php.j2 b/provisioning/templates/drupalvm.aliases.drushrc.php.j2 index 3e02de98d..b5e86455e 100644 --- a/provisioning/templates/drupalvm.aliases.drushrc.php.j2 +++ b/provisioning/templates/drupalvm.aliases.drushrc.php.j2 @@ -5,12 +5,15 @@ * * @see example.aliases.drushrc.php. */ + +{% set devtool_docroots = [adminer_install_dir, pimpmylog_install_dir, php_xhprof_html_dir] %} + {% macro alias(host, root) %} $aliases['{{ host }}'] = array( 'uri' => '{{ host }}', 'root' => '{{ root }}', 'remote-host' => '{{ host }}', - 'remote-user' => 'vagrant', + 'remote-user' => '{{ vagrant_user }}', 'ssh-options' => '-o PasswordAuthentication=no -i ~/.vagrant.d/insecure_private_key', ); @@ -18,10 +21,14 @@ $aliases['{{ host }}'] = array( {%- if drupalvm_webserver == 'apache' -%} {%- for vhost in apache_vhosts -%} - {{ alias(vhost.servername, vhost.documentroot) }} + {%- if vhost.documentroot not in devtool_docroots -%} + {{ alias(vhost.servername, vhost.documentroot) }} + {%- endif -%} {%- endfor -%} {%- elif drupalvm_webserver == 'nginx' -%} {%- for host in nginx_hosts -%} - {{ alias(host.server_name, host.root) }} + {%- if host.root not in devtool_docroots -%} + {{ alias(host.server_name, host.root) }} + {%- endif -%} {%- endfor -%} {%- endif -%} From 4da53e4a5794062c9aabe1cef3724c0ab3a80e3c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oskar=20Sch=C3=B6ldstr=C3=B6m?= Date: Mon, 1 Feb 2016 15:51:33 -0500 Subject: [PATCH 0129/1273] Follow-up #410: Use vagrant hostname instead of machine name for servernames --- example.config.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/example.config.yml b/example.config.yml index a43eb711d..ffe1ab947 100644 --- a/example.config.yml +++ b/example.config.yml @@ -47,7 +47,7 @@ install_site: true # is 'true'). drupal_major_version: 8 drupal_core_path: "/var/www/drupalvm/drupal" -drupal_domain: "{{ vagrant_machine_name }}" +drupal_domain: "{{ vagrant_hostname }}" drupal_site_name: "Drupal" drupal_install_profile: standard drupal_enable_modules: [ 'devel' ] @@ -82,17 +82,17 @@ apache_vhosts: extra_parameters: | ProxyPassMatch ^/(.*\.php(/.*)?)$ "fcgi://127.0.0.1:9000{{ drupal_core_path }}" - - servername: "adminer.{{ vagrant_machine_name }}" + - servername: "adminer.{{ vagrant_hostname }}" documentroot: "{{ adminer_install_dir }}" extra_parameters: | ProxyPassMatch ^/(.*\.php(/.*)?)$ "fcgi://127.0.0.1:9000{{ adminer_install_dir }}" - - servername: "xhprof.{{ vagrant_machine_name }}" + - servername: "xhprof.{{ vagrant_hostname }}" documentroot: "{{ php_xhprof_html_dir }}" extra_parameters: | ProxyPassMatch ^/(.*\.php(/.*)?)$ "fcgi://127.0.0.1:9000{{ php_xhprof_html_dir }}" - - servername: "pimpmylog.{{ vagrant_machine_name }}" + - servername: "pimpmylog.{{ vagrant_hostname }}" documentroot: "{{ pimpmylog_install_dir }}" extra_parameters: | ProxyPassMatch ^/(.*\.php(/.*)?)$ "fcgi://127.0.0.1:9000{{ pimpmylog_install_dir }}" @@ -113,15 +113,15 @@ nginx_hosts: root: "{{ drupal_core_path }}" is_php: true - - server_name: "adminer.{{ vagrant_machine_name }}" + - server_name: "adminer.{{ vagrant_hostname }}" root: "{{ adminer_install_dir }}" is_php: true - - server_name: "xhprof.{{ vagrant_machine_name }}" + - server_name: "xhprof.{{ vagrant_hostname }}" root: "{{ php_xhprof_html_dir }}" is_php: true - - server_name: "pimpmylog.{{ vagrant_machine_name }}" + - server_name: "pimpmylog.{{ vagrant_hostname }}" root: "{{ pimpmylog_install_dir }}" is_php: true From e11b685f591a397824d8e2a2de0bcc995f0cde35 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oskar=20Sch=C3=B6ldstr=C3=B6m?= Date: Mon, 1 Feb 2016 16:24:47 -0500 Subject: [PATCH 0130/1273] Fix build_makefile in a non-vagrant environment --- example.config.yml | 2 +- provisioning/tasks/build-makefile.yml | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/example.config.yml b/example.config.yml index ffe1ab947..f04ed951b 100644 --- a/example.config.yml +++ b/example.config.yml @@ -37,7 +37,7 @@ drupalvm_webserver: apache # Set this to false if you are using a different site deployment strategy and # would like to configure 'vagrant_synced_folders' and 'apache_vhosts' manually. build_makefile: true -drush_makefile_path: /vagrant/drupal.make.yml +drush_makefile_path: ../../drupal.make.yml # Set this to false if you don't need to install drupal (using the drupal_* # settings below), but instead copy down a database (e.g. using drush sql-sync). diff --git a/provisioning/tasks/build-makefile.yml b/provisioning/tasks/build-makefile.yml index 39cf33d98..b41cf5774 100644 --- a/provisioning/tasks/build-makefile.yml +++ b/provisioning/tasks/build-makefile.yml @@ -1,4 +1,10 @@ --- +- name: Copy drush makefile into place. + copy: + src: "{{ drush_makefile_path }}" + dest: /tmp/drupal.make.yml + when: drupal_site.stat.exists == false + - name: Ensure drupal_core_path directory exists. file: path: "{{ drupal_core_path }}" @@ -9,7 +15,7 @@ - name: Generate Drupal site with drush makefile. command: > - {{ drush_path }} make -y {{ drush_makefile_path }} --no-gitinfofile + {{ drush_path }} make -y /tmp/drupal.make.yml --no-gitinfofile chdir={{ drupal_core_path }} when: drupal_site.stat.exists == false become: no From 43914c513a02ee00593c447e6befc72f044812a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oskar=20Sch=C3=B6ldstr=C3=B6m?= Date: Mon, 1 Feb 2016 16:25:27 -0500 Subject: [PATCH 0131/1273] Keep the local drush alias when provisioning locally --- provisioning/tasks/drush-aliases.yml | 36 ++++++++++++++-------------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/provisioning/tasks/drush-aliases.yml b/provisioning/tasks/drush-aliases.yml index 71740ece9..86a5145f3 100644 --- a/provisioning/tasks/drush-aliases.yml +++ b/provisioning/tasks/drush-aliases.yml @@ -1,22 +1,4 @@ --- -- name: Ensure drush directory exists for vagrant user inside VM. - file: 'path="~/.drush" state=directory' - become: no - -- name: Configure drush aliases for vagrant user inside VM. - template: - src: ../templates/drupalvm-local.aliases.drushrc.php.j2 - dest: "~/.drush/{{ vagrant_machine_name }}.aliases.drushrc.php" - become: no - -- name: Ensure drush directory exists for root user inside VM. - file: 'path="~/.drush" state=directory' - -- name: Configure drush aliases for root user inside VM. - template: - src: ../templates/drupalvm-local.aliases.drushrc.php.j2 - dest: "~/.drush/{{ vagrant_machine_name }}.aliases.drushrc.php" - - name: Check if local Drush configuration folder exists. stat: path: ~/.drush @@ -41,3 +23,21 @@ delegate_to: 127.0.0.1 become: no when: configure_local_drush_aliases + +- name: Ensure drush directory exists for vagrant user inside VM. + file: 'path="~/.drush" state=directory' + become: no + +- name: Configure drush aliases for vagrant user inside VM. + template: + src: ../templates/drupalvm-local.aliases.drushrc.php.j2 + dest: "~/.drush/{{ vagrant_machine_name }}.aliases.drushrc.php" + become: no + +- name: Ensure drush directory exists for root user inside VM. + file: 'path="~/.drush" state=directory' + +- name: Configure drush aliases for root user inside VM. + template: + src: ../templates/drupalvm-local.aliases.drushrc.php.j2 + dest: "~/.drush/{{ vagrant_machine_name }}.aliases.drushrc.php" From 987d8573475b0dae82e523079db8787d27f815b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oskar=20Sch=C3=B6ldstr=C3=B6m?= Date: Mon, 1 Feb 2016 16:26:51 -0500 Subject: [PATCH 0132/1273] Add docker based test setup --- .travis.yml | 112 ++++++++++++++++++++++++++++------ tests/Dockerfile.centos-6 | 15 +++++ tests/Dockerfile.centos-7 | 27 ++++++++ tests/Dockerfile.ubuntu-12.04 | 11 ++++ tests/Dockerfile.ubuntu-14.04 | 11 ++++ tests/centos-7-vars.yml | 10 +++ 6 files changed, 168 insertions(+), 18 deletions(-) create mode 100644 tests/Dockerfile.centos-6 create mode 100644 tests/Dockerfile.centos-7 create mode 100644 tests/Dockerfile.ubuntu-12.04 create mode 100644 tests/Dockerfile.ubuntu-14.04 create mode 100644 tests/centos-7-vars.yml diff --git a/.travis.yml b/.travis.yml index 08ff1da89..9f296e826 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,27 +1,103 @@ ---- -language: python -python: "2.7" +sudo: required -install: - # Install Ansible. - - pip install ansible +env: + global: + - CONFIG: example.config.yml + MAKEFILE: example.drupal.make.yml + HOSTNAME: drupalvm.dev + MACHINE_NAME: drupalvm + matrix: + - distribution: centos + version: 6 + init: /sbin/init + run_opts: "--privileged" + - distribution: centos + version: 7 + init: /usr/lib/systemd/systemd + run_opts: "--privileged --volume=/sys/fs/cgroup:/sys/fs/cgroup:ro" + additional_vars: "centos-7-vars.yml" + # - distribution: ubuntu + # version: 14.04 + # init: /sbin/init + # run_opts: "--privileged" + # - distribution: ubuntu + # version: 12.04 + # init: /sbin/init + # run_opts: "--privileged" - # Add ansible.cfg to set local roles path. - - "{ echo '[defaults]'; echo 'roles_path = ../'; } >> ansible.cfg" +services: + - docker + +before_install: + # Pull container + - 'sudo docker pull ${distribution}:${version}' + # Customize container + - 'sudo docker build --rm=true --file=tests/Dockerfile.${distribution}-${version} --tag=${distribution}-${version}:ansible tests' script: - # Copy example files into place. - - cp example.config.yml config.yml - - cp example.drupal.make.yml drupal.make.yml + - container_id=$(mktemp) + + # Run container in detached state + - 'sudo docker run --detach --volume="${PWD}":/var/www/drupalvm/:rw ${run_opts} ${distribution}-${version}:ansible "${init}" > "${container_id}"' + + # Set hostname. + - 'sudo docker exec "$(cat ${container_id})" hostname ${HOSTNAME}' + + # Setup directories. + - 'sudo docker exec "$(cat ${container_id})" mkdir -p /var/www/drupalvm/drupal' + + # Install dependencies. + - 'sudo docker exec "$(cat ${container_id})" ansible-galaxy install -r /var/www/drupalvm/provisioning/requirements.yml' - # Make sure Ansible requirements install correctly. - - 'ansible-galaxy install -r provisioning/requirements.yml' + # Copy configuration files into place. + - 'sudo docker exec "$(cat ${container_id})" cp /var/www/drupalvm/$CONFIG /var/www/drupalvm/config.yml' + - 'sudo docker exec "$(cat ${container_id})" cp /var/www/drupalvm/$MAKEFILE /var/www/drupalvm/drupal.make.yml' - # Run Ansible's syntax and playbook check on the main playbook. - - 'ansible-playbook -i "localhost," -c local provisioning/playbook.yml --syntax-check' + # Append additional variables if set. + - '[[ $additional_vars ]] && sudo docker exec "$(cat ${container_id})" bash -c "cat /var/www/drupalvm/tests/${additional_vars} >> /var/www/drupalvm/config.yml"' - # Check the config file and drupal make file YAML syntax. + # Ansible syntax check. + - 'sudo docker exec --tty "$(cat ${container_id})" env TERM=xterm ansible-playbook /var/www/drupalvm/provisioning/playbook.yml --syntax-check' + + # Run the playbook with ansible-playbook. + - 'sudo docker exec --tty "$(cat ${container_id})" env TERM=xterm ansible-playbook /var/www/drupalvm/provisioning/playbook.yml' + + # Run the integration tests - > - python -c "import yaml; yaml.load( open('example.config.yml', 'r'), Loader=yaml.CLoader )" + sudo docker exec "$(cat ${container_id})" curl -s --header Host:${HOSTNAME} localhost + | grep -q 'Welcome to Drupal' + && (echo 'Drupal install pass' && exit 0) + || (echo 'Drupal install fail' && exit 1) + - > - python -c "import yaml; yaml.load( open('example.drupal.make.yml', 'r'), Loader=yaml.CLoader )" + sudo docker exec "$(cat ${container_id})" curl -s --header Host:adminer.${HOSTNAME} localhost + | grep -q '<title>Login - Adminer' + && (echo 'Admin install pass' && exit 0) + || (echo 'Adminer install fail' && exit 1) + + - > + sudo docker exec "$(cat ${container_id})" curl -s --header Host:pimpmylog.${HOSTNAME} localhost + | grep -q '<title>Pimp my Log' + && (echo 'Pimp my Log install pass' && exit 0) + || (echo 'Pimp my Log install fail' && exit 1) + + - > + sudo docker exec "$(cat ${container_id})" curl -s --header Host:xhprof.${HOSTNAME} localhost + | grep -q '<title>XHProf' + && (echo 'XHProf install pass' && exit 0) + || (echo 'XHProf install fail' && exit 1) + + - > + sudo docker exec "$(cat ${container_id})" curl -s localhost:8025 + | grep -q '<title>MailHog' + && (echo 'MailHog install pass' && exit 0) + || (echo 'MailHog install fail' && exit 1) + + - > + sudo docker exec "$(cat ${container_id})" drush @${MACHINE_NAME}.${HOSTNAME} status + | grep -q 'Drupal bootstrap.*Successful' + && (echo 'Drush install pass' && exit 0) + || (echo 'Drush install fail' && exit 1) + + # Clean up + - 'sudo docker stop "$(cat ${container_id})"' diff --git a/tests/Dockerfile.centos-6 b/tests/Dockerfile.centos-6 new file mode 100644 index 000000000..0746e50de --- /dev/null +++ b/tests/Dockerfile.centos-6 @@ -0,0 +1,15 @@ +FROM centos:6 + +# Install Ansible +RUN yum -y update; yum clean all; +RUN yum -y install epel-release +RUN yum -y install git ansible sudo which curl tar unzip xz logrotate +RUN yum clean all + +# Disable requiretty +RUN sed -i -e 's/^\(Defaults\s*requiretty\)/#--- \1/' /etc/sudoers + +# Install Ansible inventory file +RUN echo -e '[local]\nlocalhost ansible_connection=local' > /etc/ansible/hosts + +CMD ["/usr/sbin/init"] diff --git a/tests/Dockerfile.centos-7 b/tests/Dockerfile.centos-7 new file mode 100644 index 000000000..b3259e736 --- /dev/null +++ b/tests/Dockerfile.centos-7 @@ -0,0 +1,27 @@ +FROM centos:7 + +# Install systemd -- See https://hub.docker.com/_/centos/ +RUN yum -y swap -- remove fakesystemd -- install systemd systemd-libs +RUN yum -y update; yum clean all; \ +(cd /lib/systemd/system/sysinit.target.wants/; for i in *; do [ $i == systemd-tmpfiles-setup.service ] || rm -f $i; done); \ +rm -f /lib/systemd/system/multi-user.target.wants/*; \ +rm -f /etc/systemd/system/*.wants/*; \ +rm -f /lib/systemd/system/local-fs.target.wants/*; \ +rm -f /lib/systemd/system/sockets.target.wants/*udev*; \ +rm -f /lib/systemd/system/sockets.target.wants/*initctl*; \ +rm -f /lib/systemd/system/basic.target.wants/*; \ +rm -f /lib/systemd/system/anaconda.target.wants/*; + +# Install Ansible +RUN yum -y install epel-release +RUN yum -y install git ansible sudo which curl tar unzip xz logrotate initscripts +RUN yum clean all + +# Disable requiretty +RUN sed -i -e 's/^\(Defaults\s*requiretty\)/#--- \1/' /etc/sudoers + +# Install Ansible inventory file +RUN echo -e '[local]\nlocalhost ansible_connection=local' > /etc/ansible/hosts + +VOLUME ["/sys/fs/cgroup"] +CMD ["/usr/sbin/init"] diff --git a/tests/Dockerfile.ubuntu-12.04 b/tests/Dockerfile.ubuntu-12.04 new file mode 100644 index 000000000..001e03f7e --- /dev/null +++ b/tests/Dockerfile.ubuntu-12.04 @@ -0,0 +1,11 @@ +FROM ubuntu:12.04 +RUN apt-get update + +# Install Ansible +RUN apt-get install -y software-properties-common python-software-properties git +RUN apt-add-repository -y ppa:ansible/ansible +RUN apt-get update +RUN apt-get install -y ansible ufw curl + +# Install Ansible inventory file +RUN echo "[local]\nlocalhost ansible_connection=local" > /etc/ansible/hosts diff --git a/tests/Dockerfile.ubuntu-14.04 b/tests/Dockerfile.ubuntu-14.04 new file mode 100644 index 000000000..607180f93 --- /dev/null +++ b/tests/Dockerfile.ubuntu-14.04 @@ -0,0 +1,11 @@ +FROM ubuntu:14.04 +RUN apt-get update + +# Install Ansible +RUN apt-get install -y software-properties-common git +RUN apt-add-repository -y ppa:ansible/ansible +RUN apt-get update +RUN apt-get install -y ansible ufw curl + +# Install Ansible inventory file +RUN echo "[local]\nlocalhost ansible_connection=local" > /etc/ansible/hosts diff --git a/tests/centos-7-vars.yml b/tests/centos-7-vars.yml new file mode 100644 index 000000000..0b90cd6be --- /dev/null +++ b/tests/centos-7-vars.yml @@ -0,0 +1,10 @@ +mysql_packages: + - mariadb + - mariadb-server + - mariadb-libs + - MySQL-python + - perl-DBD-MySQL +mysql_daemon: mariadb +mysql_log_error: /var/log/mariadb/mariadb.log +mysql_syslog_tag: mariadb +mysql_pid_file: /var/run/mariadb/mariadb.pid From cb3d7aca15d6320dee110a9187179c5a3a9e3a89 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oskar=20Sch=C3=B6ldstr=C3=B6m?= <public@oxy.fi> Date: Fri, 5 Feb 2016 12:31:01 -0500 Subject: [PATCH 0133/1273] Add a test for nginx --- .travis.yml | 3 ++- tests/centos-6-vars.yml | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 tests/centos-6-vars.yml diff --git a/.travis.yml b/.travis.yml index 9f296e826..b2e58a442 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,6 +11,7 @@ env: version: 6 init: /sbin/init run_opts: "--privileged" + additional_vars: "centos-6-vars.yml" - distribution: centos version: 7 init: /usr/lib/systemd/systemd @@ -54,7 +55,7 @@ script: - 'sudo docker exec "$(cat ${container_id})" cp /var/www/drupalvm/$MAKEFILE /var/www/drupalvm/drupal.make.yml' # Append additional variables if set. - - '[[ $additional_vars ]] && sudo docker exec "$(cat ${container_id})" bash -c "cat /var/www/drupalvm/tests/${additional_vars} >> /var/www/drupalvm/config.yml"' + - '[[ $additional_vars ]] && sudo docker exec "$(cat ${container_id})" bash -c "cat /var/www/drupalvm/tests/${additional_vars} >> /var/www/drupalvm/config.yml" || true' # Ansible syntax check. - 'sudo docker exec --tty "$(cat ${container_id})" env TERM=xterm ansible-playbook /var/www/drupalvm/provisioning/playbook.yml --syntax-check' diff --git a/tests/centos-6-vars.yml b/tests/centos-6-vars.yml new file mode 100644 index 000000000..848ddb468 --- /dev/null +++ b/tests/centos-6-vars.yml @@ -0,0 +1 @@ +drupalvm_webserver: nginx From 5e4c9c1f112f348a3e0762d05001dc64e07ecebf Mon Sep 17 00:00:00 2001 From: Michael Mallett <mike@generalpie.com> Date: Wed, 10 Feb 2016 17:56:11 +0700 Subject: [PATCH 0134/1273] Check for post_provisioning_scripts being defined before attempting to run them --- provisioning/playbook.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/provisioning/playbook.yml b/provisioning/playbook.yml index 9b197bcdc..ea3ae3d52 100644 --- a/provisioning/playbook.yml +++ b/provisioning/playbook.yml @@ -79,3 +79,4 @@ - name: Run configured post-provision shell scripts. script: "{{ item }}" with_items: post_provision_scripts + when: post_provision_scripts is defined From 62505bc856e182d59308d69ca80edd81456c74b1 Mon Sep 17 00:00:00 2001 From: Oliver Davies <o.davies@ctidigital.com> Date: Wed, 10 Feb 2016 19:52:06 +0000 Subject: [PATCH 0135/1273] Use php_fpm_listen --- provisioning/templates/nginx-vhost.conf.j2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/provisioning/templates/nginx-vhost.conf.j2 b/provisioning/templates/nginx-vhost.conf.j2 index ef2873f0f..60c4d8ed5 100644 --- a/provisioning/templates/nginx-vhost.conf.j2 +++ b/provisioning/templates/nginx-vhost.conf.j2 @@ -34,7 +34,7 @@ server { fastcgi_intercept_errors on; fastcgi_read_timeout 120; include fastcgi_params; - fastcgi_pass 127.0.0.1:9000; + fastcgi_pass {{ php_fpm_listen }}; } location @rewrite { From 97f97b066f9ec4681a29dd006a3090836c8b9a1a Mon Sep 17 00:00:00 2001 From: Steve Purkiss <steve@purkiss.com> Date: Thu, 11 Feb 2016 14:19:44 +0000 Subject: [PATCH 0136/1273] Update drupal-console.md Drupal Console Cache Rebuild Syntax Update --- docs/extras/drupal-console.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/extras/drupal-console.md b/docs/extras/drupal-console.md index 7c0079691..dc2e7f564 100644 --- a/docs/extras/drupal-console.md +++ b/docs/extras/drupal-console.md @@ -6,15 +6,15 @@ To use Drupal Console with a Drupal 8 site (in this case, using the default conf 1. Log into the VM with `vagrant ssh`. 2. Change directory to the Drupal site's document root: `cd /var/www/drupalvm/drupal`. - 3. Use Drupal console (e.g. `drupal cache:rebuild --cache=all`). + 3. Use Drupal console (e.g. `drupal cache:rebuild all`). You should see an output like: ``` -vagrant@drupalvm:/var/www/drupalvm/drupal$ drupal cache:rebuild --cache=all +vagrant@drupalvm:/var/www/drupalvm/drupal$ drupal cache:rebuild all [+] Rebuilding cache(s), wait a moment please. [+] Done clearing cache(s). The command was executed successfully! -``` \ No newline at end of file +``` From 4d4b214042f43c0eda052725c44dfda166182aef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oskar=20Sch=C3=B6ldstr=C3=B6m?= <public@oxy.fi> Date: Tue, 26 Jan 2016 09:51:13 -0500 Subject: [PATCH 0137/1273] Add a dashboard --- example.config.yml | 7 + provisioning/playbook.yml | 1 + provisioning/tasks/dashboard.yml | 11 + provisioning/templates/dashboard.html.j2 | 317 ++++++++++++++++++ .../drupalvm-local.aliases.drushrc.php.j2 | 2 +- .../templates/drupalvm.aliases.drushrc.php.j2 | 2 +- 6 files changed, 338 insertions(+), 2 deletions(-) create mode 100644 provisioning/tasks/dashboard.yml create mode 100644 provisioning/templates/dashboard.html.j2 diff --git a/example.config.yml b/example.config.yml index f04ed951b..55ba95e31 100644 --- a/example.config.yml +++ b/example.config.yml @@ -97,6 +97,9 @@ apache_vhosts: extra_parameters: | ProxyPassMatch ^/(.*\.php(/.*)?)$ "fcgi://127.0.0.1:9000{{ pimpmylog_install_dir }}" + - servername: "{{ vagrant_ip }}" + documentroot: "{{ dashboard_install_dir }}" + apache_remove_default_vhost: true apache_mods_enabled: - expires.load @@ -125,6 +128,9 @@ nginx_hosts: root: "{{ pimpmylog_install_dir }}" is_php: true + - server_name: "{{ vagrant_ip }}" + root: "{{ dashboard_install_dir }}" + nginx_remove_default_vhost: true # MySQL Databases and users. If build_makefile: is true, first database will @@ -253,4 +259,5 @@ solr_xmx: "128M" selenium_version: 2.46.0 # Other configuration. +dashboard_install_dir: /var/www/dashboard known_hosts_path: ~/.ssh/known_hosts diff --git a/provisioning/playbook.yml b/provisioning/playbook.yml index ea3ae3d52..763ca31c6 100644 --- a/provisioning/playbook.yml +++ b/provisioning/playbook.yml @@ -75,6 +75,7 @@ - include: tasks/drush-aliases.yml - include: tasks/cron.yml + - include: tasks/dashboard.yml - name: Run configured post-provision shell scripts. script: "{{ item }}" diff --git a/provisioning/tasks/dashboard.yml b/provisioning/tasks/dashboard.yml new file mode 100644 index 000000000..4be3504f0 --- /dev/null +++ b/provisioning/tasks/dashboard.yml @@ -0,0 +1,11 @@ +- name: Ensure the dashboard directory exists + file: + path: "{{ dashboard_install_dir }}" + state: directory + mode: 0755 + +- name: Copy dashboard page into place. + template: + src: ../templates/dashboard.html.j2 + dest: "{{ dashboard_install_dir }}/index.html" + mode: 0644 diff --git a/provisioning/templates/dashboard.html.j2 b/provisioning/templates/dashboard.html.j2 new file mode 100644 index 000000000..cb2aae8c7 --- /dev/null +++ b/provisioning/templates/dashboard.html.j2 @@ -0,0 +1,317 @@ +<!DOCTYPE html> + <head> + <title>Drupal VM + + + + + {% + set devtool_docroots = [ + adminer_install_dir if 'adminer' in installed_extras else '', + php_xhprof_html_dir if 'xhprof' in installed_extras else '', + pimpmylog_install_dir if 'pimpmylog' in installed_extras else '', + dashboard_install_dir + ] + %} + + {# 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_hosts -%} + {%- 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_local_drush_aliases %} + drush @{{ vagrant_machine_name }}.{{ servername }} + {% endif %} + + {% endif %} + {%- endmacro %} + + {%- macro sectionHost() -%} +
    + {% if drupalvm_webserver == 'apache' -%} + {%- for host in apache_vhosts -%} + {%- if host.documentroot != dashboard_install_dir -%} +
  • {{ host.servername }} {{ vagrant_ip }}
  • + {%- endif -%} + {% if host.serveralias is defined -%} + {%- for alias in host.serveralias.split() -%} +
  • {{ alias }} {{ vagrant_ip }}
  • + {%- endfor -%} + {%- endif %} + {%- endfor -%} + {%- elif drupalvm_webserver == 'nginx' -%} + {%- for host in nginx_hosts -%} + {%- if host.root != dashboard_install_dir -%} +
  • {{ host.server_name }} {{ vagrant_ip }}
  • + {%- endif -%} + {%- endfor -%} + {%- endif %} +
+ {%- endmacro -%} + + {%- macro sectionSiteList() -%} + + + + + + {% if configure_local_drush_aliases -%} + + {%- endif %} + + + {% if drupalvm_webserver == 'apache' -%} + {%- for host in apache_vhosts -%} + {{ printSite(host.servername, host.documentroot) }} + {%- endfor -%} + {%- elif drupalvm_webserver == 'nginx' -%} + {%- for host in nginx_hosts -%} + {{ printSite(host.server_name, host.root) }} + {%- endfor -%} + {%- endif %} + +
HostnameDocument RootDrush alias
+ {%- endmacro -%} + + {%- macro sectionDevelopmentTools() -%} + + {% if 'adminer' in installed_extras -%} + {% set servername %}{{ getServernameFromDocroot(adminer_install_dir) }}/{{ adminer_install_filename }}{% endset %} + {%- if servername != "/{{ adminer_install_filename }}" -%} + + + + + + {%- endif -%} + {%- endif %} + {% if 'mailhog' in installed_extras -%} + {% set servername %}{{ vagrant_hostname }}:8025{% endset %} + {%- if servername != ":8025" -%} + + + + + + {%- endif -%} + {%- endif %} + {% if 'pimpmylog' in installed_extras -%} + {% set servername = getServernameFromDocroot(pimpmylog_install_dir) %} + {%- if servername -%} + + + + + + {%- endif -%} + {%- endif %} + {% if 'solr' in installed_extras -%} + {% set servername %}{{ vagrant_hostname }}:{{ solr_port }}/solr/{% endset %} + + + + + + {%- endif %} + {% if 'xhprof' in installed_extras -%} + {% set servername = getServernameFromDocroot(php_xhprof_html_dir) %} + {%- if servername -%} + + + + + + {%- endif -%} + {%- endif %} +
Adminer{{ servername }} + Open + Documentation +
MailHog{{ servername }} + Open + Documentation +
PimpMyLog{{ servername }} + Open + Documentation +
Solr{{ servername }} + Open + Documentation +
XHProf{{ servername }} + Open + Documentation +
+ {%- endmacro -%} + + {%- macro sectionDatabaseConnection() -%} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
MySQL Hostname127.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() -%} + + + + + {% if 'adminer' in installed_extras -%} + + {%- endif %} + + + + {% for database in mysql_databases -%} + + + {% if 'adminer' in installed_extras -%} + + {%- endif %} + + {%- endfor %} + +
Database name
{{ database.name }} + Adminer +
+ {%- endmacro -%} + + {%- macro sectionDatabaseUserList() -%} + + + + + + + + + {% for user in mysql_users -%} + + + + + {%- endfor %} + +
UsernamePassword
{{ user.name }}{{ user.password }}
+ {%- endmacro -%} + +
+ +
+
+
+
+
+ Drupal VM +

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

+

Read the documentation

+
+ +
+
/etc/hosts
+
+ {{ sectionHost() }} +
+ Unless you're using the vagrant-hostsupdater plugin, add the following to your host machine's hosts file. +
+
+
+
+
+ +
+
+ +
+
Your sites
+
+ {{ sectionSiteList() }} +
+
+ +
+
Development tools
+
+ {{ sectionDevelopmentTools() }} +
+
+
+ +
+
+
MySQL connection information
+
+ {{ sectionDatabaseConnection() }} +
+
+ +
+
Databases
+
+ {{ sectionDatabaseList() }} + + {{ sectionDatabaseUserList() }} +
+
+
+
+ +
+ + + + diff --git a/provisioning/templates/drupalvm-local.aliases.drushrc.php.j2 b/provisioning/templates/drupalvm-local.aliases.drushrc.php.j2 index 3c690f17a..ea82a09db 100644 --- a/provisioning/templates/drupalvm-local.aliases.drushrc.php.j2 +++ b/provisioning/templates/drupalvm-local.aliases.drushrc.php.j2 @@ -6,7 +6,7 @@ * @see example.aliases.drushrc.php. */ -{% set devtool_docroots = [adminer_install_dir, pimpmylog_install_dir, php_xhprof_html_dir] %} +{% set devtool_docroots = [adminer_install_dir, pimpmylog_install_dir, php_xhprof_html_dir, dashboard_install_dir] %} {% macro alias(host, root) %} $aliases['{{ host }}'] = array( diff --git a/provisioning/templates/drupalvm.aliases.drushrc.php.j2 b/provisioning/templates/drupalvm.aliases.drushrc.php.j2 index b5e86455e..45151b91c 100644 --- a/provisioning/templates/drupalvm.aliases.drushrc.php.j2 +++ b/provisioning/templates/drupalvm.aliases.drushrc.php.j2 @@ -6,7 +6,7 @@ * @see example.aliases.drushrc.php. */ -{% set devtool_docroots = [adminer_install_dir, pimpmylog_install_dir, php_xhprof_html_dir] %} +{% set devtool_docroots = [adminer_install_dir, pimpmylog_install_dir, php_xhprof_html_dir, dashboard_install_dir] %} {% macro alias(host, root) %} $aliases['{{ host }}'] = array( From 69c2c35a4bb6767fbfed45f3b9cfc1e5770916a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oskar=20Sch=C3=B6ldstr=C3=B6m?= Date: Fri, 12 Feb 2016 09:08:40 -0500 Subject: [PATCH 0138/1273] Add a test for the dashboard --- .travis.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.travis.yml b/.travis.yml index b2e58a442..fe14982b4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,6 +6,7 @@ env: MAKEFILE: example.drupal.make.yml HOSTNAME: drupalvm.dev MACHINE_NAME: drupalvm + IP: 192.168.88.88 matrix: - distribution: centos version: 6 @@ -94,6 +95,12 @@ script: && (echo 'MailHog install pass' && exit 0) || (echo 'MailHog install fail' && exit 1) + - > + sudo docker exec "$(cat ${container_id})" curl -s --header Host:${IP} localhost + | grep -q "
  • ${HOSTNAME} ${IP}
  • " + && (echo 'Dashboard install pass' && exit 0) + || (echo 'Dashboard install fail' && exit 1) + - > sudo docker exec "$(cat ${container_id})" drush @${MACHINE_NAME}.${HOSTNAME} status | grep -q 'Drupal bootstrap.*Successful' From ac94d7e1977f0d9ac0a8bf595b254998507ff6fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oskar=20Sch=C3=B6ldstr=C3=B6m?= Date: Fri, 12 Feb 2016 10:39:12 -0500 Subject: [PATCH 0139/1273] Use macros instead of block set tag --- provisioning/templates/dashboard.html.j2 | 38 ++++++++++++------------ 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/provisioning/templates/dashboard.html.j2 b/provisioning/templates/dashboard.html.j2 index cb2aae8c7..5512aaade 100644 --- a/provisioning/templates/dashboard.html.j2 +++ b/provisioning/templates/dashboard.html.j2 @@ -107,63 +107,63 @@ {%- macro sectionDevelopmentTools() -%} {% if 'adminer' in installed_extras -%} - {% set servername %}{{ getServernameFromDocroot(adminer_install_dir) }}/{{ adminer_install_filename }}{% endset %} - {%- if servername != "/{{ adminer_install_filename }}" -%} + {% macro servername() %}{{ getServernameFromDocroot(adminer_install_dir) }}/{{ adminer_install_filename }}{% endmacro %} + {%- if servername() != "/{{ adminer_install_filename }}" -%} - + {%- endif -%} {%- endif %} {% if 'mailhog' in installed_extras -%} - {% set servername %}{{ vagrant_hostname }}:8025{% endset %} - {%- if servername != ":8025" -%} + {% macro servername() %}{{ vagrant_hostname }}:8025{% endmacro %} + {%- if servername() != ":8025" -%} - + {%- endif -%} {%- endif %} {% if 'pimpmylog' in installed_extras -%} - {% set servername = getServernameFromDocroot(pimpmylog_install_dir) %} - {%- if servername -%} + {% macro servername() %}{{ getServernameFromDocroot(pimpmylog_install_dir) }}{% endmacro %} + {%- if servername() -%} - + {%- endif -%} {%- endif %} {% if 'solr' in installed_extras -%} - {% set servername %}{{ vagrant_hostname }}:{{ solr_port }}/solr/{% endset %} + {% macro servername() %}{{ vagrant_hostname }}:{{ solr_port }}/solr/{% endmacro %} - + {%- endif %} {% if 'xhprof' in installed_extras -%} - {% set servername = getServernameFromDocroot(php_xhprof_html_dir) %} - {%- if servername -%} + {% macro servername() %}{{ getServernameFromDocroot(php_xhprof_html_dir) }}{% endmacro %} + {%- if servername() -%} - + From 8265f232e457d5ab4282c49777d0542a313d84fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oskar=20Sch=C3=B6ldstr=C3=B6m?= Date: Fri, 12 Feb 2016 16:08:16 -0500 Subject: [PATCH 0140/1273] Make the docroot_install_dir variable backwards compatible --- provisioning/playbook.yml | 3 +++ provisioning/templates/dashboard.html.j2 | 11 +---------- .../templates/drupalvm-local.aliases.drushrc.php.j2 | 6 ++---- .../templates/drupalvm.aliases.drushrc.php.j2 | 6 ++---- provisioning/vars/main.yml | 6 ++++++ 5 files changed, 14 insertions(+), 18 deletions(-) create mode 100644 provisioning/vars/main.yml diff --git a/provisioning/playbook.yml b/provisioning/playbook.yml index 763ca31c6..8b6838fb3 100644 --- a/provisioning/playbook.yml +++ b/provisioning/playbook.yml @@ -3,6 +3,7 @@ become: yes vars_files: + - vars/main.yml - ../config.yml pre_tasks: @@ -75,7 +76,9 @@ - include: tasks/drush-aliases.yml - include: tasks/cron.yml + - include: tasks/dashboard.yml + when: dashboard_install_dir is defined - name: Run configured post-provision shell scripts. script: "{{ item }}" diff --git a/provisioning/templates/dashboard.html.j2 b/provisioning/templates/dashboard.html.j2 index 5512aaade..1dda79a86 100644 --- a/provisioning/templates/dashboard.html.j2 +++ b/provisioning/templates/dashboard.html.j2 @@ -19,15 +19,6 @@ - {% - set devtool_docroots = [ - adminer_install_dir if 'adminer' in installed_extras else '', - php_xhprof_html_dir if 'xhprof' in installed_extras else '', - pimpmylog_install_dir if 'pimpmylog' in installed_extras else '', - dashboard_install_dir - ] - %} - {# Returns the hosts server name based on the document root #} {%- macro getServernameFromDocroot(path) -%} {%- if drupalvm_webserver == 'apache' -%} @@ -46,7 +37,7 @@ {%- endmacro -%} {%- macro printSite(servername, docroot) -%} - {%- if docroot not in devtool_docroots -%} + {%- if docroot not in _devtool_docroots -%} diff --git a/provisioning/templates/drupalvm-local.aliases.drushrc.php.j2 b/provisioning/templates/drupalvm-local.aliases.drushrc.php.j2 index ea82a09db..2881b49ec 100644 --- a/provisioning/templates/drupalvm-local.aliases.drushrc.php.j2 +++ b/provisioning/templates/drupalvm-local.aliases.drushrc.php.j2 @@ -6,8 +6,6 @@ * @see example.aliases.drushrc.php. */ -{% set devtool_docroots = [adminer_install_dir, pimpmylog_install_dir, php_xhprof_html_dir, dashboard_install_dir] %} - {% macro alias(host, root) %} $aliases['{{ host }}'] = array( 'uri' => '{{ host }}', @@ -18,13 +16,13 @@ $aliases['{{ host }}'] = array( {%- if drupalvm_webserver == 'apache' -%} {%- for vhost in apache_vhosts -%} - {%- if vhost.documentroot not in devtool_docroots -%} + {%- if vhost.documentroot not in _devtool_docroots -%} {{ alias(vhost.servername, vhost.documentroot) }} {%- endif -%} {%- endfor -%} {%- elif drupalvm_webserver == 'nginx' -%} {%- for host in nginx_hosts -%} - {%- if host.root not in devtool_docroots -%} + {%- if host.root not in _devtool_docroots -%} {{ alias(host.server_name, host.root) }} {%- endif -%} {%- endfor -%} diff --git a/provisioning/templates/drupalvm.aliases.drushrc.php.j2 b/provisioning/templates/drupalvm.aliases.drushrc.php.j2 index 45151b91c..88145c181 100644 --- a/provisioning/templates/drupalvm.aliases.drushrc.php.j2 +++ b/provisioning/templates/drupalvm.aliases.drushrc.php.j2 @@ -6,8 +6,6 @@ * @see example.aliases.drushrc.php. */ -{% set devtool_docroots = [adminer_install_dir, pimpmylog_install_dir, php_xhprof_html_dir, dashboard_install_dir] %} - {% macro alias(host, root) %} $aliases['{{ host }}'] = array( 'uri' => '{{ host }}', @@ -21,13 +19,13 @@ $aliases['{{ host }}'] = array( {%- if drupalvm_webserver == 'apache' -%} {%- for vhost in apache_vhosts -%} - {%- if vhost.documentroot not in devtool_docroots -%} + {%- if vhost.documentroot not in _devtool_docroots -%} {{ alias(vhost.servername, vhost.documentroot) }} {%- endif -%} {%- endfor -%} {%- elif drupalvm_webserver == 'nginx' -%} {%- for host in nginx_hosts -%} - {%- if host.root not in devtool_docroots -%} + {%- if host.root not in _devtool_docroots -%} {{ alias(host.server_name, host.root) }} {%- endif -%} {%- endfor -%} diff --git a/provisioning/vars/main.yml b/provisioning/vars/main.yml new file mode 100644 index 000000000..905659ad0 --- /dev/null +++ b/provisioning/vars/main.yml @@ -0,0 +1,6 @@ +--- +_devtool_docroots: + - "{{ adminer_install_dir }}" + - "{{ pimpmylog_install_dir }}" + - "{{ php_xhprof_html_dir }}" + - "{{ dashboard_install_dir|default('') }}" From 7d4ff24d2c294b28c827bb3ab78738e552ff6b4f Mon Sep 17 00:00:00 2001 From: "Shawn S. Smiley" Date: Mon, 15 Feb 2016 19:51:56 -0500 Subject: [PATCH 0141/1273] Add docs about using SSL vhosts --- docs/extras/ssl.md | 11 +++++++++++ mkdocs.yml | 1 + 2 files changed, 12 insertions(+) create mode 100644 docs/extras/ssl.md diff --git a/docs/extras/ssl.md b/docs/extras/ssl.md new file mode 100644 index 000000000..13653ae9e --- /dev/null +++ b/docs/extras/ssl.md @@ -0,0 +1,11 @@ +If you are using Ubuntu as your base OS and you want to get started quickly with a local development environment you can use the snakeoil certificate that is already generated. + +```yaml +apache_vhosts_ssl: + - servername: "{{ drupal_domain }}" + documentroot: "{{ drupal_core_path }}" + certificate_file: "/etc/ssl/certs/ssl-cert-snakeoil.pem" + certificate_key_file: "/etc/ssl/private/ssl-cert-snakeoil.key" + extra_parameters: | + ProxyPassMatch ^/(.*\.php(/.*)?)$ "fcgi://127.0.0.1:9000{{ drupal_core_path }}" +``` diff --git a/mkdocs.yml b/mkdocs.yml index 285442986..cf1c81fed 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -23,6 +23,7 @@ pages: - 'Use Varnish with Drupal VM': 'extras/varnish.md' - 'Use MariaDB instead of MySQL': 'extras/mariadb.md' - 'Use Node.js and NPM': 'extras/nodejs.md' + - 'Use SSL vhosts with Apache': 'extras/ssl.md' - 'View Logs with Pimp my Log': 'extras/pimpmylog.md' - 'Profile Code with XHProf': 'extras/xhprof.md' - 'Debug Code with XDebug': 'extras/xdebug.md' From 491ae5e053365ca0eb7dcda8d40ffa33ed57e9bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oskar=20Sch=C3=B6ldstr=C3=B6m?= Date: Mon, 15 Feb 2016 19:53:03 -0500 Subject: [PATCH 0142/1273] Add SSL docs about generating a certificate for CentOS --- docs/extras/ssl.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/docs/extras/ssl.md b/docs/extras/ssl.md index 13653ae9e..709cbae31 100644 --- a/docs/extras/ssl.md +++ b/docs/extras/ssl.md @@ -1,3 +1,25 @@ +To enable SSL support for you virtual hosts you first need a certificate file. You can generate a self-signed certificate with a command like + + openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout example.key -out example.crt + +Place the files in your project directory and add the following to your `config.yml`. + +```yaml +apache_vhosts_ssl: + - servername: "{{ drupal_domain }}" + documentroot: "{{ drupal_core_path }}" + certificate_file: "/vagrant/example.crt" + certificate_key_file: "/vagrant/example.key" + extra_parameters: | + ProxyPassMatch ^/(.*\.php(/.*)?)$ "fcgi://127.0.0.1:9000{{ drupal_core_path }}" +``` + +_If you're using an actual production certificate you should of course **NOT** track it in git but transfer it to the VM before running `vagrant provision`_ + +For a list of all configuration options see the [`geerlingguy.apache` Ansible role's README](https://github.com/geerlingguy/ansible-role-apache#readme). + +### Using Ubuntu's snakeoil certificate + If you are using Ubuntu as your base OS and you want to get started quickly with a local development environment you can use the snakeoil certificate that is already generated. ```yaml From 2f08088f5b9094f5876f28b74aa8fc6cd382646d Mon Sep 17 00:00:00 2001 From: Jeff Geerling Date: Tue, 16 Feb 2016 11:07:03 -0600 Subject: [PATCH 0143/1273] Fixes #352 and Fixes #440: Update docs on tools that integrate with Drupal VM. --- docs/other/cloning-with-newd.md | 15 --------- docs/other/management-tools.md | 59 +++++++++++++++++++++++++++++++++ mkdocs.yml | 2 +- 3 files changed, 60 insertions(+), 16 deletions(-) delete mode 100644 docs/other/cloning-with-newd.md create mode 100644 docs/other/management-tools.md diff --git a/docs/other/cloning-with-newd.md b/docs/other/cloning-with-newd.md deleted file mode 100644 index 286b8f835..000000000 --- a/docs/other/cloning-with-newd.md +++ /dev/null @@ -1,15 +0,0 @@ -[@rgoodie](https://github.com/rgoodie) created a function called `newd` that clones this repo, uses `sed` to change configuration to Drupal 7 if desired, renames the VM to something other than drupalvm.dev, and kicks off `vagrant up`. - -Example: - -``` -# Create a new Drupal VM named 'test-fieldformatter' with Drupal 7. -$ newd 7 test-fieldformatter - -# Create a new Drupal VM named 'drupal8test' with Drupal 8. -$ newd 8 drupal8test -``` - -The source code for this new bash function (you could add it to your own `.bash_profile` or `.profile`) is located [in this gist](https://gist.github.com/rgoodie/9966f30b404a4daa59e1). - -Do you have your own wrapper script or other helpers to help you manage instances of Drupal VM? Please share it on this page! \ No newline at end of file diff --git a/docs/other/management-tools.md b/docs/other/management-tools.md new file mode 100644 index 000000000..14e7d5c4d --- /dev/null +++ b/docs/other/management-tools.md @@ -0,0 +1,59 @@ +There are some upstream tools which aid in the creation and management of Drupal VM instances. Some of the more popular tools are listed here. + +If you know of any other tools to help manage Drupal VM, please add them to this page! + +## Lunchbox + +[Lunchbox](https://github.com/LunchboxDevTools/lunchbox) is a wrapper for the Drupal VM project to manage your Drupal development process. It is a Node.js-based GUI to assist in setting up Drupal VM and creating and managing instances. + +## Drupal VM Config Generator + +[Drupal VM Config Generator](https://github.com/opdavies/drupal-vm-config-generator) is a Symfony Console application that manages and customises configuration files for Drupal VM projects. + +You can either use the interactive console UI to build configurations, or pass options directly to the `drupalvm-generate` command. + +Examples: + +``` +drupalvm-generate \ + --hostname=example.com \ + --machine-name=example \ + --ip-address=192.168.88.88 \ + --cpus=1 \ + --memory=512 \ + --webserver=nginx \ + --domain=example.com \ + --path=../site \ + --destination=/var/www/site \ + --docroot=/var/www/site/drupal \ + --drupal-version=8 \ + --build-makefile=no \ + --install-site=true \ + --installed-extras=xdebug,xhprof \ + --force +``` + +## Drupal VM Generator + +[generator-drupalvm](https://github.com/kevinquillen/generator-drupalvm) is a Yeoman generator for quickly spawning configured VMs or new projects using Drupal VM. + +Examples: + +``` +# Generate a new Drupal VM instance in the current directory. +$ yo drupalvm +``` + +## Newd + +[`newd`](https://gist.github.com/rgoodie/9966f30b404a4daa59e1) is a bash function that quickly clones the Drupal VM repo wherever you need it, configures important bits, and then kicks off `vagrant up`. + +Examples: + +``` +# Create a new Drupal VM named 'test-fieldformatter' with Drupal 7. +$ newd 7 test-fieldformatter + +# Create a new Drupal VM named 'drupal8test' with Drupal 8. +$ newd 8 drupal8test +``` diff --git a/mkdocs.yml b/mkdocs.yml index 285442986..083e69937 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -34,9 +34,9 @@ pages: - 'Using Different Webservers': 'other/webservers.md' - 'Using a local Vagrantfile': 'other/local-vagrantfile.md' - 'PHP 7 on Drupal VM': 'other/php-7.md' + - 'Drupal VM Management Tools': 'other/management-tools.md' - 'Networking Notes': 'other/networking.md' - 'Drupal 6 Notes': 'other/drupal-6.md' - 'Linux Notes': 'other/linux.md' - 'Windows Notes': 'other/windows.md' - - 'Cloning Drupal VM with newd': 'other/cloning-with-newd.md' - 'Vagrant and VirtualBox Tips': 'other/vagrant-virtualbox.md' From de7f1417edd1f35310b08471bb979ad40abb3592 Mon Sep 17 00:00:00 2001 From: Frank Anderson Date: Wed, 17 Feb 2016 14:41:53 -0800 Subject: [PATCH 0144/1273] Update example.config.yml Added version numbers to the nodejs version description. To stem confusion from #417 --- example.config.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/example.config.yml b/example.config.yml index f04ed951b..96829a786 100644 --- a/example.config.yml +++ b/example.config.yml @@ -161,7 +161,11 @@ installed_extras: extra_packages: - unzip -# `nodejs` must be in installed_extras for this to work. +# `nodejs` must be in installed_extras for this to work. This currently only +# runs on the initial provision. If the version needs to chanage 'nvm' will need +# to be installed and configured manually. +# The nodejs role uses the Nodesource binary sources +# 4.x, 5.x, 0.12, or 0.10 are acceptable versions. nodejs_version: "0.12" nodejs_npm_global_packages: [] From bdbfe00140713e933f21d672530779eb042a475c Mon Sep 17 00:00:00 2001 From: Frank Anderson Date: Wed, 17 Feb 2016 14:58:17 -0800 Subject: [PATCH 0145/1273] Update example.config.yml --- example.config.yml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/example.config.yml b/example.config.yml index 96829a786..292f95300 100644 --- a/example.config.yml +++ b/example.config.yml @@ -161,11 +161,8 @@ installed_extras: extra_packages: - unzip -# `nodejs` must be in installed_extras for this to work. This currently only -# runs on the initial provision. If the version needs to chanage 'nvm' will need -# to be installed and configured manually. -# The nodejs role uses the Nodesource binary sources -# 4.x, 5.x, 0.12, or 0.10 are acceptable versions. +# `nodejs` must be in installed_extras for this to work. Valid examples: "0.10", +# "0.12", "4.x", "5.x". nodejs_version: "0.12" nodejs_npm_global_packages: [] From 4599d02b5dbadc30545b1229f2acfb68d59e9ec4 Mon Sep 17 00:00:00 2001 From: Jeff Geerling Date: Wed, 17 Feb 2016 23:59:12 -0600 Subject: [PATCH 0146/1273] Fixes #445: Switch back to JJG-Ansible-Windows to stop the bleeding. --- Vagrantfile | 15 +++-- provisioning/JJG-Ansible-Windows/LICENSE | 20 +++++++ provisioning/JJG-Ansible-Windows/README.md | 42 +++++++++++++ provisioning/JJG-Ansible-Windows/windows.sh | 66 +++++++++++++++++++++ 4 files changed, 139 insertions(+), 4 deletions(-) create mode 100755 provisioning/JJG-Ansible-Windows/LICENSE create mode 100755 provisioning/JJG-Ansible-Windows/README.md create mode 100755 provisioning/JJG-Ansible-Windows/windows.sh diff --git a/Vagrantfile b/Vagrantfile index 2a1995986..76bc87fde 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -104,17 +104,24 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| # Allow override of the default synced folder type. config.vm.synced_folder ".", "/vagrant", type: vconfig.include?('vagrant_synced_folder_default_type') ? vconfig['vagrant_default_synced_folder_type'] : 'nfs' - # Provisioning. Use ansible if it's installed on host, ansible_local if not. + # Provisioning. Use ansible if it's installed, JJG-Ansible-Windows if not. if which('ansible-playbook') config.vm.provision "ansible" do |ansible| ansible.playbook = "#{dir}/provisioning/playbook.yml" end else - config.vm.provision "ansible_local" do |ansible| - ansible.playbook = "provisioning/playbook.yml" - ansible.galaxy_role_file = "provisioning/requirements.yml" + config.vm.provision "shell" do |sh| + sh.path = "#{dir}/provisioning/JJG-Ansible-Windows/windows.sh" + sh.args = "/provisioning/playbook.yml" end end + # ansible_local provisioner is broken in Vagrant < 1.8.2. + # else + # config.vm.provision "ansible_local" do |ansible| + # ansible.playbook = "provisioning/playbook.yml" + # ansible.galaxy_role_file = "provisioning/requirements.yml" + # end + # end # VMware Fusion. config.vm.provider :vmware_fusion do |v, override| diff --git a/provisioning/JJG-Ansible-Windows/LICENSE b/provisioning/JJG-Ansible-Windows/LICENSE new file mode 100755 index 000000000..378188abb --- /dev/null +++ b/provisioning/JJG-Ansible-Windows/LICENSE @@ -0,0 +1,20 @@ +The MIT License (MIT) + +Copyright (c) 2014 Jeff Geerling + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/provisioning/JJG-Ansible-Windows/README.md b/provisioning/JJG-Ansible-Windows/README.md new file mode 100755 index 000000000..c64b4a664 --- /dev/null +++ b/provisioning/JJG-Ansible-Windows/README.md @@ -0,0 +1,42 @@ +# JJG-Ansible-Windows + +> **Important Note**: Vagrant now includes an [`ansible_local` provisioner](https://docs.vagrantup.com/v2/provisioning/ansible_local.html), which provides a much more reliable Ansible provisioning experience within a Vagrant VM. This project will likely no longer be updated for use beyond Vagrant 1.7.x. + +Windows shell provisioning script to bootstrap Ansible from within a Vagrant VM running on Windows. + +This script is configured to use configure any Linux-based VM (Debian, Ubuntu, Fedora, RedHat, CentOS, etc.) so it can run Ansible playbooks from within the VM through Vagrant. + +Read more about this script, and other techniques for using Ansible within a Windows environment, on Server Check.in: [Running Ansible within Windows](https://servercheck.in/blog/running-ansible-within-windows). + +## Usage + +In your Vagrantfile, use a conditional provisioning statement if you want to use this script (which runs Ansible from within the VM instead of on your host—this example assumes your playbook is inside within a 'provisioning' folder, and this script is within provisioning/JJG-Ansible-Windows): + +```ruby +# Use rbconfig to determine if we're on a windows host or not. +require 'rbconfig' +is_windows = (RbConfig::CONFIG['host_os'] =~ /mswin|mingw|cygwin/) +if is_windows + # Provisioning configuration for shell script. + config.vm.provision "shell" do |sh| + sh.path = "provisioning/JJG-Ansible-Windows/windows.sh" + sh.args = "provisioning/playbook.yml" + end +else + # Provisioning configuration for Ansible (for Mac/Linux hosts). + config.vm.provision "ansible" do |ansible| + ansible.playbook = "provisioning/playbook.yml" + ansible.sudo = true + end +end +``` + +Note that the `windows.sh` script will run within the VM and will run the given playbook against localhost with `--connection=local` inside the VM. You shouldn't/can't pass a custom inventory file to the script, as you can using Vagrant's Ansible provisioner. + +### Role Requirements File + +If your playbook requires roles to be installed which are not present in a `roles` directory within the playbook's directory, then you should add the roles to a [role requirements](http://docs.ansible.com/galaxy.html#advanced-control-over-role-requirements-files) file. Place the resulting `requirements.txt` or `requirements.yml` file in the same directory as your playbook, and the roles will be installed automatically. + +## Licensing and More Info + +Created by [Jeff Geerling](http://jeffgeerling.com/) in 2014. Licensed under the MIT license; see the LICENSE file for more info. diff --git a/provisioning/JJG-Ansible-Windows/windows.sh b/provisioning/JJG-Ansible-Windows/windows.sh new file mode 100755 index 000000000..c8a375af0 --- /dev/null +++ b/provisioning/JJG-Ansible-Windows/windows.sh @@ -0,0 +1,66 @@ +#!/bin/bash +# +# Windows shell provisioner for Ansible playbooks, based on KSid's +# windows-vagrant-ansible: https://github.com/KSid/windows-vagrant-ansible +# +# @see README.md +# @author Jeff Geerling, 2014 + +# Uncomment if behind a proxy server. +# export {http,https,ftp}_proxy='http://username:password@proxy-host:80' + +ANSIBLE_PLAYBOOK=$1 +PLAYBOOK_DIR=${ANSIBLE_PLAYBOOK%/*} + +# Detect package management system. +YUM=$(which yum 2>/dev/null) +APT_GET=$(which apt-get 2>/dev/null) + +# Make sure Ansible playbook exists. +if [ ! -f "/vagrant/$ANSIBLE_PLAYBOOK" ]; then + echo "Cannot find Ansible playbook." + exit 1 +fi + +# Install Ansible and its dependencies if it's not installed already. +if ! command -v ansible >/dev/null; then + echo "Installing Ansible dependencies and Git." + if [[ ! -z ${YUM} ]]; then + yum install -y git python python-devel + elif [[ ! -z ${APT_GET} ]]; then + apt-get update + apt-get install -y git python python-dev + else + echo "Neither yum nor apt-get are available." + exit 1; + fi + + echo "Installing pip via easy_install." + wget https://raw.githubusercontent.com/ActiveState/ez_setup/v0.9/ez_setup.py + python ez_setup.py && rm -f ez_setup.py + easy_install pip + + # Make sure setuptools are installed crrectly. + pip install setuptools --no-use-wheel --upgrade + + # Install GCC / required build tools. + if [[ ! -z $YUM ]]; then + yum install -y gcc + elif [[ ! -z $APT_GET ]]; then + apt-get install -y build-essential + fi + + echo "Installing required python modules." + pip install paramiko pyyaml jinja2 markupsafe + + echo "Installing Ansible." + pip install ansible +fi + +# Install requirements. +echo "Installing Ansible roles from requirements file, if available." +find "/vagrant/$PLAYBOOK_DIR" \( -name "requirements.yml" -o -name "requirements.txt" \) -exec sudo ansible-galaxy install --ignore-errors -r {} \; + +# Run the playbook. +echo "Running Ansible provisioner defined in Vagrantfile." +ansible-playbook -i 'localhost,' "/vagrant/${ANSIBLE_PLAYBOOK}" --extra-vars "is_windows=true" --connection=local From ec96163cb057fe7a5cba3306fa09f2c2f302a3dc Mon Sep 17 00:00:00 2001 From: Jeff Geerling Date: Thu, 18 Feb 2016 00:00:33 -0600 Subject: [PATCH 0147/1273] PR #396 Follow-up to fix Vagrant version. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 38f0434a4..8c541eaa3 100644 --- a/README.md +++ b/README.md @@ -61,7 +61,7 @@ Note for Faster Provisioning (Mac/Linux only): *[Install Ansible](http://docs.an Note for Linux users: *If NFS is not already installed on your host, you will need to install it to use the default NFS synced folder configuration. See guides for [Debian/Ubuntu](https://www.digitalocean.com/community/tutorials/how-to-set-up-an-nfs-mount-on-ubuntu-14-04), [Arch](https://wiki.archlinux.org/index.php/NFS#Installation), and [RHEL/CentOS](https://www.digitalocean.com/community/tutorials/how-to-set-up-an-nfs-mount-on-centos-6).* -Note on versions: *Please make sure you're running the latest stable version of Vagrant, VirtualBox, and Ansible, as the current version of Drupal VM is tested with the latest releases. As of February 2016: Vagrant 1.8.2, VirtualBox 5.0.14, and Ansible 2.0.0.* +Note on versions: *Please make sure you're running the latest stable version of Vagrant, VirtualBox, and Ansible, as the current version of Drupal VM is tested with the latest releases. As of February 2016: Vagrant 1.8.1, VirtualBox 5.0.14, and Ansible 2.0.0.* ### 2 - Build the Virtual Machine From 4608c2eea02bbb271a303c6728e14d15298bd9c1 Mon Sep 17 00:00:00 2001 From: Jeroen van de Schraaf Date: Thu, 18 Feb 2016 13:34:34 +0100 Subject: [PATCH 0148/1273] Add support for vagrant-hostmanager plugin. --- Vagrantfile | 35 ++++++++++++++++++++--------------- 1 file changed, 20 insertions(+), 15 deletions(-) diff --git a/Vagrantfile b/Vagrantfile index 76bc87fde..686a9576b 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -63,25 +63,30 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| # Vagrant box. config.vm.box = vconfig['vagrant_box'] - # If hostsupdater plugin is installed, add all server names as aliases. - if Vagrant.has_plugin?("vagrant-hostsupdater") - aliases = [] - blacklist = [config.vm.hostname, vconfig['vagrant_ip']] - if vconfig['drupalvm_webserver'] == "apache" - vconfig['apache_vhosts'].each do |host| - unless blacklist.include?(host['servername']) - aliases.push(host['servername']) - end - aliases.concat(host['serveralias'].split()) if host['serveralias'] + # If a hostsfile manager plugin is installed, add all server names as aliases. + aliases = [] + blacklist = [config.vm.hostname, vconfig['vagrant_ip']] + if vconfig['drupalvm_webserver'] == "apache" + vconfig['apache_vhosts'].each do |host| + unless blacklist.include?(host['servername']) + aliases.push(host['servername']) end - else - vconfig['nginx_hosts'].each do |host| - unless blacklist.include?(host['server_name']) - aliases.push(host['server_name']) - end + aliases.concat(host['serveralias'].split()) if host['serveralias'] + end + else + vconfig['nginx_hosts'].each do |host| + unless blacklist.include?(host['server_name']) + aliases.push(host['server_name']) end end + end + + if Vagrant.has_plugin?("vagrant-hostsupdater") config.hostsupdater.aliases = aliases.uniq + elsif Vagrant.has_plugin?("vagrant-hostmanager") + config.hostmanager.enabled = true + config.hostmanager.manage_host = true + config.hostmanager.aliases = aliases.uniq end # Synced folders. From c778ab383da4039de924531f5ef93d4af23fac50 Mon Sep 17 00:00:00 2001 From: Jeff Geerling Date: Thu, 18 Feb 2016 09:54:12 -0600 Subject: [PATCH 0149/1273] PR #453 and Issue #451: Document support for vagrant-hostmanager plugin. --- README.md | 2 +- docs/other/windows.md | 2 +- provisioning/templates/dashboard.html.j2 | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 8c541eaa3..ed616bb87 100644 --- a/README.md +++ b/README.md @@ -79,7 +79,7 @@ Note: *If there are any errors during the course of running `vagrant up`, and it ### 3 - Configure your host machine to access the VM. 1. [Edit your hosts file](http://www.rackspace.com/knowledge_center/article/how-do-i-modify-my-hosts-file), adding the line `192.168.88.88 drupalvm.dev` so you can connect to the VM. - - You can have Vagrant automatically configure your hosts file if you install the `hostsupdater` plugin (`vagrant plugin install vagrant-hostsupdater`). All hosts defined in `apache_vhosts` or `nginx_hosts` will be automatically managed. + - You can have Vagrant automatically configure your hosts file if you install the `hostsupdater` plugin (`vagrant plugin install vagrant-hostsupdater`). All hosts defined in `apache_vhosts` or `nginx_hosts` will be automatically managed. The `vagrant-hostmanager` plugin is also supported. - You can also have Vagrant automatically assign an available IP address to your VM if you install the `auto_network` plugin (`vagrant plugin install vagrant-auto_network`), and set `vagrant_ip` to `0.0.0.0` inside `config.yml`. 2. Open your browser and access [http://drupalvm.dev/](http://drupalvm.dev/). The default login for the admin account is `admin` for both the username and password. diff --git a/docs/other/windows.md b/docs/other/windows.md index ee4b4d2ac..0bb6f9381 100644 --- a/docs/other/windows.md +++ b/docs/other/windows.md @@ -47,7 +47,7 @@ If you are running Windows 7 and `vagrant up` hangs, you may need to upgrade Pow ## Hosts file updates -If you install the `vagrant-hostsupdater` plugin, you might get a permissions error when Vagrant tries changing the hosts file. On a Mac or Linux workstation, you're prompted for a sudo password so the change can be made, but on Windows, you have to do one of the following to make sure hostsupdater works correctly: +If you install either the `vagrant-hostsupdater` or `vagrant-hostmanager` plugin, you might get a permissions error when Vagrant tries changing the hosts file. On a Mac or Linux workstation, you're prompted for a sudo password so the change can be made, but on Windows, you have to do one of the following to make sure hostsupdater works correctly: 1. Run PowerShell or whatever CLI you use with Vagrant as an administrator. Right click on the application and select 'Run as administrator', then proceed with `vagrant` commands as normal. 2. Change the permissions on the hosts file so anyone can edit the file (this has security implications, so it's best to use option 1 unless you know what you're doing). diff --git a/provisioning/templates/dashboard.html.j2 b/provisioning/templates/dashboard.html.j2 index 1dda79a86..22cec2245 100644 --- a/provisioning/templates/dashboard.html.j2 +++ b/provisioning/templates/dashboard.html.j2 @@ -257,7 +257,7 @@
    {{ sectionHost() }}
    - Unless you're using the vagrant-hostsupdater plugin, add the following to your host machine's hosts file. + Unless you're using the vagrant-hostsupdater or vagrant-hostmanager plugin, add the lines above to your host machine's hosts file. From 8802b9a5186df5873aa5826642dd8cff42970c3a Mon Sep 17 00:00:00 2001 From: Jeff Geerling Date: Thu, 18 Feb 2016 10:31:23 -0600 Subject: [PATCH 0150/1273] Fixes #451: Link dashboard page logo to drupalvm.com. --- provisioning/templates/dashboard.html.j2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/provisioning/templates/dashboard.html.j2 b/provisioning/templates/dashboard.html.j2 index 22cec2245..15fa52f9e 100644 --- a/provisioning/templates/dashboard.html.j2 +++ b/provisioning/templates/dashboard.html.j2 @@ -247,7 +247,7 @@
    - Drupal VM + Drupal VM

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

    Read the documentation

    From 5cc51fb7a00fc5543a9e14d8dfe96d095197d51f Mon Sep 17 00:00:00 2001 From: Jeff Geerling Date: Fri, 19 Feb 2016 12:02:05 -0600 Subject: [PATCH 0151/1273] Fixes #433: Add alternative WinNFSD documentation and mention Cmder. --- docs/other/windows.md | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/docs/other/windows.md b/docs/other/windows.md index 0bb6f9381..d54e5bdc4 100644 --- a/docs/other/windows.md +++ b/docs/other/windows.md @@ -1,5 +1,12 @@ There are a few caveats when using Drupal VM on Windows, and this page will try to identify the main gotchas or optimization tips for those wishing to use Drupal VM on a Windows host. +## Command line environment + +You can use PowerShell, Git Bash, Git Shell, or other PowerShell-based environments with Drupal VM and Vagrant; however you might want to consider using a more POSIX-like environment so you can more easily work with Drupal VM: + + - [Cmder](http://cmder.net/) includes built-in git and SSH support, so you can do most things that you need without any additional plugins. + - [Cygwin](https://www.cygwin.com/) allows you to install a large variety of linux packages inside its bash environment, though it can be a little more tricky to manage and is less integrated into the Windows environment. + ## Synced Folders Most issues have to do synced folders. These are the most common ones: @@ -10,7 +17,7 @@ By default, if you use the 'NFS' synced folder type, Vagrant will ignore this di 1. **Install the `vagrant-winnfsd` plugin**. See the 'NFS' section later for more details and caveats. 2. **Use `smb` for the synced folder's type.** - 2. **Use `rsync` for the synced folder's type.** This requires that you have `rsync` available on your Windows workstation, which you can get if you install a substitute CLI like [Cygwin](https://www.cygwin.com/). + 2. **Use `rsync` for the synced folder's type.** This requires that you have `rsync` available on your Windows workstation, which you can get if you install a substitute CLI like [Cygwin](https://www.cygwin.com/) or [Cmder](http://cmder.net/). ### Symbolic Links @@ -33,6 +40,10 @@ You should probably disable Git's `fileMode` option inside the VM and on your ho You can use the [vagrant-winnfsd](https://github.com/GM-Alex/vagrant-winnfsd) plugin to get NFS support on windows. Be aware that there are multiple issues logged against both the plugin and the winnfsd project, so no guarantees. +#### Using WinNFSD without `vagrant-winnfsd` + +Another option for the more adventurous is to manually install and configure WinNFSD, and manually mount the shares within your VM. This requires a bit more work, but could be more stable on Windows; see this blog post for more details: [Windows + Vagrant + WinNFSD without file update problems](https://hollyit.net/blog/windowsvagrantwinnfsd-without-file-update-problems). + ### "Authentication failure" on vagrant up Some Windows users have reported running into an issue where an authentication failure is reported once the VM is booted (e.g. `drupalvm: Warning: Authentication failure. Retrying...` — see [#170](https://github.com/geerlingguy/drupal-vm/issues/170)). To fix this, do the following: @@ -50,7 +61,7 @@ If you are running Windows 7 and `vagrant up` hangs, you may need to upgrade Pow If you install either the `vagrant-hostsupdater` or `vagrant-hostmanager` plugin, you might get a permissions error when Vagrant tries changing the hosts file. On a Mac or Linux workstation, you're prompted for a sudo password so the change can be made, but on Windows, you have to do one of the following to make sure hostsupdater works correctly: 1. Run PowerShell or whatever CLI you use with Vagrant as an administrator. Right click on the application and select 'Run as administrator', then proceed with `vagrant` commands as normal. - 2. Change the permissions on the hosts file so anyone can edit the file (this has security implications, so it's best to use option 1 unless you know what you're doing). + 2. Change the permissions on the hosts file so your account has permission to edit the file (this has security implications, so it's best to use option 1 unless you know what you're doing). To do this, open `%SystemRoot%\system32\drivers\etc` in Windows Explorer, right-click the `hosts` file, and under Security, add your account and give yourself full access to the file. ## Intel VT-x virtualization support From 532ccf77a2354ae249c00c4c9b87434e82809623 Mon Sep 17 00:00:00 2001 From: Jeff Geerling Date: Fri, 19 Feb 2016 12:16:05 -0600 Subject: [PATCH 0152/1273] Fixes #454: Add minimum system requirements. --- README.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/README.md b/README.md index ed616bb87..21b90d26a 100644 --- a/README.md +++ b/README.md @@ -108,6 +108,16 @@ If you don't want or need one or more of these extras, just delete them or comme Drupal VM is built to integrate with every developer's workflow. Many guides for using Drupal VM for common development tasks are available on the [Drupal VM documentation site](http://docs.drupalvm.com). +## System Requirements + +Drupal VM runs on almost any modern computer that can run VirtualBox and Vagrant, however for the best out-of-the-box experience, it's recommended you have a computer with at least: + + - Intel Core i5, i7 or better processor + - At least 4 GB RAM (higher is better) + - An SSD (for greater speed with synced folders) + +If you have an older processor or a processor without VT-x virtualization support (e.g. the i3), you can still use Drupal VM, but you will need to switch the `vagrant_box` in `config.yml` to use a 3rd party 32-bit box, like `ubuntu/trusty32` or `hashicorp/precise32`. + ## Other Notes - To shut down the virtual machine, enter `vagrant halt` in the Terminal in the same folder that has the `Vagrantfile`. To destroy it completely (if you want to save a little disk space, or want to rebuild it from scratch with `vagrant up` again), type in `vagrant destroy`. From e9c5cefd32cdff73e021c21929e38591294e8759 Mon Sep 17 00:00:00 2001 From: Jeff Geerling Date: Sat, 20 Feb 2016 22:37:06 -0600 Subject: [PATCH 0153/1273] Fixes #84: Make Drupal VM prod-ready (with a DigitalOcean guide). --- .gitignore | 1 + examples/prod/README.md | 55 ++++++++++++++++++------ examples/prod/bootstrap/example.vars.yml | 15 +++++++ examples/prod/bootstrap/init.yml | 30 +++++++++++++ examples/prod/example.inventory | 2 +- examples/prod/prod.overrides.yml | 7 ++- provisioning/tasks/build-makefile.yml | 11 ++++- 7 files changed, 103 insertions(+), 18 deletions(-) create mode 100644 examples/prod/bootstrap/example.vars.yml create mode 100644 examples/prod/bootstrap/init.yml diff --git a/.gitignore b/.gitignore index b48a04283..c864bfad7 100644 --- a/.gitignore +++ b/.gitignore @@ -8,5 +8,6 @@ config.yml drupal.make.yml Vagrantfile.local examples/prod/inventory +examples/prod/bootstrap/vars.yml scripts/ roles/ diff --git a/examples/prod/README.md b/examples/prod/README.md index cb31e308e..71a8bd413 100644 --- a/examples/prod/README.md +++ b/examples/prod/README.md @@ -1,10 +1,12 @@ # Drupal VM Production Configuration Example +> **Important**: This feature is currently in 'experimental' status, and the security of your servers is _your_ responsibility. + This directory contains an example production configuration for Drupal VM which can be used to deploy Drupal VM to a production environment on a cloud provider like DigitalOcean, Linode, or AWS. -This README file contains instructions for how you can use this configuration file to build a Drupal environment on DigitalOcean. +This README file contains instructions for how you can use this configuration file to build a Drupal environment with Drupal VM on DigitalOcean. -## Creating a DigitalOcean Droplet +## Create a DigitalOcean Droplet If you don't already have a DigitalOcean account, create one (you can use geerlingguy's [affiliate link](https://www.digitalocean.com/?refcode=b9c57af84643) to sign up, otherwise, visit the normal [DigitalOcean Sign Up form](https://cloud.digitalocean.com/registrations/new). @@ -12,24 +14,24 @@ Make sure you have an SSH key you can use to connect to your DigitalOcean drople Once you are logged into DigitalOcean and have added your SSH key, click the 'Create Droplet' button on your Droplets page. For the Droplet, choose the following options: - - **Hostname**: Choose a hostname for your site (e.g. `example.drupalvm.com`) + - **Image**: Choose `Ubuntu 14.04.x x64` - **Size**: 1 GB / 1 CPU (currently $10/month; you can choose a higher plan if needed) - **Region**: Choose whatever region is geographically nearest to you and your site visitors - **Settings**: (Nothing here affects how Drupal VM works, choose what you'd like) - - **Image**: Choose `Ubuntu 14.04 x64` - **Add SSH Keys**: Select the SSH key you added to your account earlier. + - **Hostname**: Choose a hostname for your site (e.g. `example.drupalvm.com`) Click 'Create Droplet', and wait a minute or so while the Droplet is booted. Once it's booted, make sure you can log into it from your local computer: - ssh root@[droplet-hostname] + ssh root@[droplet-hostname-or-ip] -(Make sure you replace `[droplet-hostname]`) with the hostname or IP address of your Droplet!) +(Make sure you replace `[droplet-hostname-or-ip]`) with the hostname or IP address of your Droplet!) If you get a warning like "the authenticity of the host can't be established", answer yes to the prompt and hit enter. You should now be logged into the Droplet. Log back out by typing `exit` at the prompt and hitting return. Your DigitalOcean Droplet is booted and ready to have Drupal VM installed on it. -## Customizing `config.yml` and `inventory` for production +## Customize `config.yml` and `inventory` for production Just like you would with the normal `example.config.yml`, you need to copy the file to `config.yml`, then go through `prod.overrides.yml` (in this directory), and make sure to update your `config.yml`, making sure all the variables are set to match `prod.overrides.yml`. @@ -38,18 +40,43 @@ The changes outlined in `prod.overrides.yml` disable development-environment too The only other thing you need to do is copy the inventory file `example.inventory` to `inventory` (so it is located at `prod/inventory`). By default, it reads: [drupalvm] - 1.2.3.4 ansible_ssh_user=root + 1.2.3.4 ansible_ssh_user=my_admin_username + +Change the host `1.2.3.4` to either the IP address or the hostname of your DigitalOcean Droplet. Remember that if you would like to use a hostname, you need to make sure the hostname actually resolves to your Droplet's IP address, either in your domain's public DNS configuration, or via your local hosts file. + +## Initialize the server with an administrative account + +> Note: This guide assumes you have Ansible [installed](http://docs.ansible.com/ansible/intro_installation.html) on your host machine. + +The first step in setting up Drupal VM on the cloud server is to initialize the server with an administrative account (which is separate from the `root` user account for better security). -Change the host `1.2.3.4` to either the IP address or the hostname of your DigitalOcean Droplet. Remember that if you would like to use a hostname, you need to make sure that hostname actually resolves to your Droplet's IP address, either in your domain's public DNS configuration, or via your local hosts file. +Inside the `examples/prod/bootstrap` folder, copy the `example.vars.yml` file to `vars.yml` and update the variables in that file for your own administrative account (make sure especially to update the `admin_password` value!). -## Provisioning Drupal VM on the Droplet +Then, run the following command within Drupal VM's root directory (the folder containing the `Vagrantfile`): -Run the following command within this project's root directory (the folder containing the `Vagrantfile`): + ansible-playbook -i examples/prod/inventory examples/prod/bootstrap/init.yml -e "ansible_ssh_user=root" - ansible-playbook -i examples/prod/inventory provisioning/playbook.yml --sudo +Once the initialization is complete, you can test your new admin login with `ssh my_admin_username@droplet-hostname-or-ip`. You should be logged in via your existing SSH key. Log back out with `exit`. + +## Provision Drupal VM on the Droplet + +Run the following command within Drupal VM's root directory (the folder containing the `Vagrantfile`): + + ansible-playbook -i examples/prod/inventory provisioning/playbook.yml --sudo --ask-sudo-pass + +Ansible will prompt you for your admin account's `sudo` password (the same as the password you encrypted and saved as `admin_password`). Enter it and press return. After a few minutes, your Drupal-VM-in-the-cloud Droplet should be fully configured to match your local development environment! You can visit your Droplet and access the fresh Drupal site just like you would locally (e.g. `http://example.drupalvm.com/`). -## Going Further +## Known issues + + - The `files` folder that is generated during the initial Drupal installation is set to be owned by the admin account; to make it work (and to allow Drupal to generate stylesheets and files correctly), you have to manually log into the server and run `sudo chown -R www-data:www-data /var/www/drupalvm/drupal/sites/default/files` after initial provisioning is complete. + - You can't synchronize folders between your host machine and DigitalOcean (at least not in any sane way); so you'll need to either have Drupal VM install a site from a given Drush make file or composer.json, or deploy your site yourself. + - The way you build a production Drupal VM instance (vs. a local instance) is a little bit of a kludge. Follow https://github.com/geerlingguy/drupal-vm/issues/455 to track progress on a more streamlined process. + - Drupal VM doesn't include any kind of backup system. You should use one if you have any kind of important data on your server! + +## Go Further + +You can use Ubuntu 12.04, Ubuntu 14.04, CentOS 6 or CentOS 7 when you build the DigitalOcean Droplet. Just like with Drupal VM running locally, you can customize almost every aspect of the server! -You may want to customize your configuration further, to make sure Drupal VM is tuned for your specific Drupal site's needs, or you may want to change things and make the server configuration more flexible, etc. For all that, the book [Ansible for DevOps](http://ansiblefordevops.com/) will give you a great introduction to using Ansible to make Drupal VM and the included Ansible configuration do exactly what you need! +You may want to customize your configuration even further, to make sure Drupal VM is tuned for your specific Drupal site's needs, or you may want to change things and make the server configuration more flexible, etc. For all that, the book [Ansible for DevOps](http://ansiblefordevops.com/) will give you a great introduction to using Ansible to make Drupal VM and the included Ansible configuration do exactly what you need! diff --git a/examples/prod/bootstrap/example.vars.yml b/examples/prod/bootstrap/example.vars.yml new file mode 100644 index 000000000..ac61fef4e --- /dev/null +++ b/examples/prod/bootstrap/example.vars.yml @@ -0,0 +1,15 @@ +--- +admin_user: my_admin_username + +# On RHEL/CentOS, 'wheel'; on Debian/Ubuntu, 'root'. +admin_group: root + +# IMPORTANT: Configure your own password for the admin user account. To generate +# a password hash, use either of the following commands: +# - `openssl passwd -1 [password]` +# - `mkpasswd --method=SHA-512`. +admin_password: $1$HgT69GsW$qZ8FUJHafZZWD76KXgAZO/ + +# Configuration for copying local public SSH key to admin's authorized_keys. +admin_copy_ssh_pubkey: true +admin_pubkey: ~/.ssh/id_rsa.pub diff --git a/examples/prod/bootstrap/init.yml b/examples/prod/bootstrap/init.yml new file mode 100644 index 000000000..5bdfc3bdf --- /dev/null +++ b/examples/prod/bootstrap/init.yml @@ -0,0 +1,30 @@ +--- +- hosts: drupalvm + + vars_files: + - vars.yml + + tasks: + - name: Create admin user account. + user: + name: "{{ admin_user }}" + createhome: yes + home: "/home/{{ admin_user }}" + generate_ssh_key: yes + ssh_key_comment: "ansible-{{ inventory_hostname }}" + password: "{{ admin_password }}" + groups: "{{ admin_group }}" + shell: /bin/bash + + - name: Add local SSH public key to admin account authorized_keys. + authorized_key: + user: "{{ admin_user }}" + key: "{{ lookup('file', '{{ admin_pubkey }}') }}" + manage_dir: yes + + - name: Disable requiretty. + lineinfile: + dest: /etc/sudoers + regexp: '^Defaults.+requiretty' + line: 'Defaults !requiretty' + state: present diff --git a/examples/prod/example.inventory b/examples/prod/example.inventory index a5967b064..9a10cfe60 100644 --- a/examples/prod/example.inventory +++ b/examples/prod/example.inventory @@ -1,2 +1,2 @@ [drupalvm] -1.2.3.4 ansible_ssh_user=root +1.2.3.4 ansible_ssh_user=my_admin_username diff --git a/examples/prod/prod.overrides.yml b/examples/prod/prod.overrides.yml index 40b3e9b4a..d93b55a22 100644 --- a/examples/prod/prod.overrides.yml +++ b/examples/prod/prod.overrides.yml @@ -11,10 +11,14 @@ mysql_root_password: root # Only install extras that you will need/use on your site, and don't install # development-related software on production environments! installed_extras: - - memcached + # - memcached + # - redis # - solr - varnish +# Disable the dashboard page. Also remove any unneeded virtualhosts. +dashboard_install_dir: '' + # Enable a more hardened security configuration. extra_security_enabled: true @@ -23,7 +27,6 @@ firewall_allowed_tcp_ports: - "22" - "80" - "443" - - "8983" firewall_log_dropped_packets: true # Set Apache to listen on port 81 (internal only), and Varnish on 80. diff --git a/provisioning/tasks/build-makefile.yml b/provisioning/tasks/build-makefile.yml index b41cf5774..838c602f8 100644 --- a/provisioning/tasks/build-makefile.yml +++ b/provisioning/tasks/build-makefile.yml @@ -9,8 +9,17 @@ file: path: "{{ drupal_core_path }}" state: directory + recurse: yes + mode: 0775 + when: drupal_site.stat.exists == false + +- name: Ensure drupal_core_path directory is owned by ssh user. + file: + path: "{{ drupal_core_path }}" + state: directory + owner: "{{ ansible_ssh_user }}" + group: "{{ ansible_ssh_user }}" mode: 0775 - become: no when: drupal_site.stat.exists == false - name: Generate Drupal site with drush makefile. From 724b410cf872fb11fdca530472ca952c18f36e4a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oskar=20Sch=C3=B6ldstr=C3=B6m?= Date: Sun, 21 Feb 2016 00:29:45 -0500 Subject: [PATCH 0154/1273] Add custom initctl script for fixing docker tests on ubuntu 14.04 --- .travis.yml | 8 ++++---- tests/Dockerfile.ubuntu-14.04 | 3 +++ tests/initctl_faker | 23 +++++++++++++++++++++++ 3 files changed, 30 insertions(+), 4 deletions(-) create mode 100644 tests/initctl_faker diff --git a/.travis.yml b/.travis.yml index fe14982b4..ba68b012f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,10 +18,10 @@ env: init: /usr/lib/systemd/systemd run_opts: "--privileged --volume=/sys/fs/cgroup:/sys/fs/cgroup:ro" additional_vars: "centos-7-vars.yml" - # - distribution: ubuntu - # version: 14.04 - # init: /sbin/init - # run_opts: "--privileged" + - distribution: ubuntu + version: 14.04 + init: /sbin/init + run_opts: "--privileged" # - distribution: ubuntu # version: 12.04 # init: /sbin/init diff --git a/tests/Dockerfile.ubuntu-14.04 b/tests/Dockerfile.ubuntu-14.04 index 607180f93..266f96287 100644 --- a/tests/Dockerfile.ubuntu-14.04 +++ b/tests/Dockerfile.ubuntu-14.04 @@ -7,5 +7,8 @@ RUN apt-add-repository -y ppa:ansible/ansible RUN apt-get update RUN apt-get install -y ansible ufw curl +COPY initctl_faker . +RUN chmod +x initctl_faker && rm -fr /sbin/initctl && ln -s /initctl_faker /sbin/initctl + # Install Ansible inventory file RUN echo "[local]\nlocalhost ansible_connection=local" > /etc/ansible/hosts diff --git a/tests/initctl_faker b/tests/initctl_faker new file mode 100644 index 000000000..a2267f30d --- /dev/null +++ b/tests/initctl_faker @@ -0,0 +1,23 @@ +#!/bin/sh +ALIAS_CMD="$(echo ""$0"" | sed -e 's?/sbin/??')" + +case "$ALIAS_CMD" in + start|stop|restart|reload|status) + exec service $1 $ALIAS_CMD + ;; +esac + +case "$1" in + list ) + exec service --status-all + ;; + reload-configuration ) + exec service $2 restart + ;; + start|stop|restart|reload|status) + exec service $2 $1 + ;; + \?) + exit 0 + ;; +esac From 84b3ad6cf65fb87ac60777c5aca55bb82a45b4aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oskar=20Sch=C3=B6ldstr=C3=B6m?= Date: Sun, 21 Feb 2016 08:40:44 -0500 Subject: [PATCH 0155/1273] Detect whether AppArmor is installed before attempting to interact with it --- provisioning/tasks/apparmor.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/provisioning/tasks/apparmor.yml b/provisioning/tasks/apparmor.yml index 926f65cf6..516ebf054 100644 --- a/provisioning/tasks/apparmor.yml +++ b/provisioning/tasks/apparmor.yml @@ -1,12 +1,17 @@ --- +- name: Detect if AppArmor is installed. + stat: + path: /etc/init.d/apparmor + register: apparmor_installed + - name: Ensure MySQL AppArmor profile is disabled (for slow query log). file: path: /etc/apparmor.d/disable/usr.sbin.mysqld src: /etc/apparmor.d/usr.sbin.mysqld state: link register: mysql_apparmor - when: mysql_slow_query_log_enabled + when: mysql_slow_query_log_enabled and apparmor_installed.stat.exists -- name: Restart AppArmor if necessary. +- name: Restart the AppArmor if necessary. service: name=apparmor state=restarted when: mysql_apparmor.changed From 363e2c744ca2fbd4efb9cc145550750730f00809 Mon Sep 17 00:00:00 2001 From: Jeff Geerling Date: Sun, 21 Feb 2016 20:28:20 -0600 Subject: [PATCH 0156/1273] Fixes #434: Ditch slow CentOS 6 test build and test Nginx with Ubuntu 14.04. --- .travis.yml | 18 +++++++----------- tests/Dockerfile.centos-6 | 15 --------------- tests/Dockerfile.ubuntu-12.04 | 11 ----------- tests/centos-6-vars.yml | 1 - tests/centos-7-vars.yml | 1 + 5 files changed, 8 insertions(+), 38 deletions(-) delete mode 100644 tests/Dockerfile.centos-6 delete mode 100644 tests/Dockerfile.ubuntu-12.04 delete mode 100644 tests/centos-6-vars.yml diff --git a/.travis.yml b/.travis.yml index ba68b012f..681cb63c6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,24 +8,20 @@ env: MACHINE_NAME: drupalvm IP: 192.168.88.88 matrix: - - distribution: centos - version: 6 + - distribution: ubuntu + version: 14.04 init: /sbin/init run_opts: "--privileged" - additional_vars: "centos-6-vars.yml" + - distribution: ubuntu + version: 14.04 + init: /sbin/init + run_opts: "--privileged" + additional_vars: ubuntu-14-nginx.yml - distribution: centos version: 7 init: /usr/lib/systemd/systemd run_opts: "--privileged --volume=/sys/fs/cgroup:/sys/fs/cgroup:ro" additional_vars: "centos-7-vars.yml" - - distribution: ubuntu - version: 14.04 - init: /sbin/init - run_opts: "--privileged" - # - distribution: ubuntu - # version: 12.04 - # init: /sbin/init - # run_opts: "--privileged" services: - docker diff --git a/tests/Dockerfile.centos-6 b/tests/Dockerfile.centos-6 deleted file mode 100644 index 0746e50de..000000000 --- a/tests/Dockerfile.centos-6 +++ /dev/null @@ -1,15 +0,0 @@ -FROM centos:6 - -# Install Ansible -RUN yum -y update; yum clean all; -RUN yum -y install epel-release -RUN yum -y install git ansible sudo which curl tar unzip xz logrotate -RUN yum clean all - -# Disable requiretty -RUN sed -i -e 's/^\(Defaults\s*requiretty\)/#--- \1/' /etc/sudoers - -# Install Ansible inventory file -RUN echo -e '[local]\nlocalhost ansible_connection=local' > /etc/ansible/hosts - -CMD ["/usr/sbin/init"] diff --git a/tests/Dockerfile.ubuntu-12.04 b/tests/Dockerfile.ubuntu-12.04 deleted file mode 100644 index 001e03f7e..000000000 --- a/tests/Dockerfile.ubuntu-12.04 +++ /dev/null @@ -1,11 +0,0 @@ -FROM ubuntu:12.04 -RUN apt-get update - -# Install Ansible -RUN apt-get install -y software-properties-common python-software-properties git -RUN apt-add-repository -y ppa:ansible/ansible -RUN apt-get update -RUN apt-get install -y ansible ufw curl - -# Install Ansible inventory file -RUN echo "[local]\nlocalhost ansible_connection=local" > /etc/ansible/hosts diff --git a/tests/centos-6-vars.yml b/tests/centos-6-vars.yml deleted file mode 100644 index 848ddb468..000000000 --- a/tests/centos-6-vars.yml +++ /dev/null @@ -1 +0,0 @@ -drupalvm_webserver: nginx diff --git a/tests/centos-7-vars.yml b/tests/centos-7-vars.yml index 0b90cd6be..1b0b69304 100644 --- a/tests/centos-7-vars.yml +++ b/tests/centos-7-vars.yml @@ -1,3 +1,4 @@ +--- mysql_packages: - mariadb - mariadb-server From 3046b6bdaf35d1ca7f6a9214e0e6a2f0b051b76f Mon Sep 17 00:00:00 2001 From: Jeff Geerling Date: Sun, 21 Feb 2016 20:38:03 -0600 Subject: [PATCH 0157/1273] Issue #434: Fix syntax error with include method. --- .travis.yml | 1 + tests/centos-7-vars.yml | 1 - tests/ubuntu-14-nginx.yml | 1 + 3 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 tests/ubuntu-14-nginx.yml diff --git a/.travis.yml b/.travis.yml index 681cb63c6..edb277b5f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,3 +1,4 @@ +--- sudo: required env: diff --git a/tests/centos-7-vars.yml b/tests/centos-7-vars.yml index 1b0b69304..0b90cd6be 100644 --- a/tests/centos-7-vars.yml +++ b/tests/centos-7-vars.yml @@ -1,4 +1,3 @@ ---- mysql_packages: - mariadb - mariadb-server diff --git a/tests/ubuntu-14-nginx.yml b/tests/ubuntu-14-nginx.yml new file mode 100644 index 000000000..848ddb468 --- /dev/null +++ b/tests/ubuntu-14-nginx.yml @@ -0,0 +1 @@ +drupalvm_webserver: nginx From 2c886c81f27bc61911a3c63d3aa5ab7d458485d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oskar=20Sch=C3=B6ldstr=C3=B6m?= Date: Tue, 23 Feb 2016 07:35:10 -0500 Subject: [PATCH 0158/1273] Issue #461: Fix variable typo for vagrant_synced_folder_default_type --- Vagrantfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Vagrantfile b/Vagrantfile index 686a9576b..216e4fcc2 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -107,7 +107,7 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| end # Allow override of the default synced folder type. - config.vm.synced_folder ".", "/vagrant", type: vconfig.include?('vagrant_synced_folder_default_type') ? vconfig['vagrant_default_synced_folder_type'] : 'nfs' + config.vm.synced_folder ".", "/vagrant", type: vconfig.include?('vagrant_synced_folder_default_type') ? vconfig['vagrant_synced_folder_default_type'] : 'nfs' # Provisioning. Use ansible if it's installed, JJG-Ansible-Windows if not. if which('ansible-playbook') From 72c4197e179b11f7a58e8b32e76fb7a6e9919d9b Mon Sep 17 00:00:00 2001 From: Jeff Geerling Date: Tue, 23 Feb 2016 15:26:14 -0600 Subject: [PATCH 0159/1273] Fixes #464: Make sure drupal_core_path is created in Vagrant successfully. --- provisioning/tasks/build-makefile.yml | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/provisioning/tasks/build-makefile.yml b/provisioning/tasks/build-makefile.yml index 838c602f8..0c503acd2 100644 --- a/provisioning/tasks/build-makefile.yml +++ b/provisioning/tasks/build-makefile.yml @@ -11,15 +11,7 @@ state: directory recurse: yes mode: 0775 - when: drupal_site.stat.exists == false - -- name: Ensure drupal_core_path directory is owned by ssh user. - file: - path: "{{ drupal_core_path }}" - state: directory - owner: "{{ ansible_ssh_user }}" - group: "{{ ansible_ssh_user }}" - mode: 0775 + become: no when: drupal_site.stat.exists == false - name: Generate Drupal site with drush makefile. From bf4a99d23ca4f20f109ea0ccb179275d9347c0ba Mon Sep 17 00:00:00 2001 From: Jeff Geerling Date: Tue, 23 Feb 2016 15:29:08 -0600 Subject: [PATCH 0160/1273] Fixes #463: Dashboard doesn't appear if using autonetwork plugin, add dashboard. to vhost. --- example.config.yml | 5 +++-- provisioning/tasks/www.yml | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/example.config.yml b/example.config.yml index 8f24386ee..62c7201d4 100644 --- a/example.config.yml +++ b/example.config.yml @@ -9,7 +9,7 @@ vagrant_synced_folder_default_type: nfs # machine name, and IP address for each instance. vagrant_hostname: drupalvm.dev vagrant_machine_name: drupalvm -vagrant_ip: 192.168.88.88 +vagrant_ip: 0.0.0.0 # Allow Drupal VM to be accessed via a public network interface on your host. # Vagrant boxes are insecure by default, so be careful. You've been warned! @@ -98,6 +98,7 @@ apache_vhosts: ProxyPassMatch ^/(.*\.php(/.*)?)$ "fcgi://127.0.0.1:9000{{ pimpmylog_install_dir }}" - servername: "{{ vagrant_ip }}" + serveralias: "dashboard.{{ vagrant_hostname }}" documentroot: "{{ dashboard_install_dir }}" apache_remove_default_vhost: true @@ -128,7 +129,7 @@ nginx_hosts: root: "{{ pimpmylog_install_dir }}" is_php: true - - server_name: "{{ vagrant_ip }}" + - server_name: "{{ vagrant_ip }} dashboard.{{ vagrant_hostname }}" root: "{{ dashboard_install_dir }}" nginx_remove_default_vhost: true diff --git a/provisioning/tasks/www.yml b/provisioning/tasks/www.yml index 159b709ec..775653b63 100644 --- a/provisioning/tasks/www.yml +++ b/provisioning/tasks/www.yml @@ -26,7 +26,7 @@ - name: Copy Nginx vhosts into place. template: src: ../templates/nginx-vhost.conf.j2 - dest: "{{ nginx_vhost_path }}/{{ item.server_name }}.conf" + dest: "{{ nginx_vhost_path }}/{{ item.server_name.split(' ')[0] }}.conf" force: yes owner: root group: root From 12c8ca6b098ea99db9ce5644c59768a8ddb5e3f4 Mon Sep 17 00:00:00 2001 From: Jeff Geerling Date: Tue, 23 Feb 2016 16:13:54 -0600 Subject: [PATCH 0161/1273] Fix default IP - related to work in #463. --- example.config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/example.config.yml b/example.config.yml index 62c7201d4..b4e407b42 100644 --- a/example.config.yml +++ b/example.config.yml @@ -9,7 +9,7 @@ vagrant_synced_folder_default_type: nfs # machine name, and IP address for each instance. vagrant_hostname: drupalvm.dev vagrant_machine_name: drupalvm -vagrant_ip: 0.0.0.0 +vagrant_ip: 192.168.88.88 # Allow Drupal VM to be accessed via a public network interface on your host. # Vagrant boxes are insecure by default, so be careful. You've been warned! From deae528bb0438058180fd14996c56748267ad152 Mon Sep 17 00:00:00 2001 From: Jeff Geerling Date: Wed, 24 Feb 2016 10:37:06 -0600 Subject: [PATCH 0162/1273] Update PHP 7 install documentation to reflect unneccessary Apache PHP mod. --- docs/other/php-7.md | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/docs/other/php-7.md b/docs/other/php-7.md index bc1b80022..6ee43fe78 100644 --- a/docs/other/php-7.md +++ b/docs/other/php-7.md @@ -9,7 +9,6 @@ Ondřej Surý's PPA for PHP 7.0 is included with Drupal VM, and you can make the ```yaml php_version: "7.0" php_packages: - - libapache2-mod-php7.0 - php7.0-common - php7.0-cli - php7.0-dev @@ -29,12 +28,10 @@ Also, comment out `xhprof`, `xdebug`, `redis` and `memcached` from the `installe You can also build from source using the same/included `geerlingguy.php` Ansible role, but that process is a bit more involved and for power users comfortable with the process. -**If you're using Nginx** instead of Apache, don't include `libapache2-mod-php7.0` in the `php_packages` list in `config.yml`. - ## RedHat/CentOS 7 Remi's RPM repository is included with Drupal VM, and you can make the following changes to use it to install PHP 7: 1. Make sure you've followed the directions for switching to CentOS 7 in the [use a different base OS](base-os.md) guide. 2. Change `php_version` inside `config.yml` to `"7.0"`. - 3. Comment out `xhprof`, `xdebug`, `redis` and `memcached` from the `installed_extras` list, as these extensions are not yet supported for PHP 7 (as of late 2015). + 3. Comment out `xhprof`, `xdebug`, `redis` and `memcached` from the `installed_extras` list, as these extensions are not yet supported for PHP 7 (as of early 2016). From 39b16d6e65a36efbef86ce734dbc721901c4a0ac Mon Sep 17 00:00:00 2001 From: Jeff Geerling Date: Wed, 24 Feb 2016 12:07:04 -0600 Subject: [PATCH 0163/1273] Issue #455: Add notes to get effective DigitalOcean instance running. --- examples/prod/README.md | 9 ++++++++- examples/prod/prod.overrides.yml | 8 ++++++++ provisioning/playbook.yml | 2 +- 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/examples/prod/README.md b/examples/prod/README.md index 71a8bd413..be0664bbd 100644 --- a/examples/prod/README.md +++ b/examples/prod/README.md @@ -70,7 +70,14 @@ After a few minutes, your Drupal-VM-in-the-cloud Droplet should be fully configu ## Known issues - - The `files` folder that is generated during the initial Drupal installation is set to be owned by the admin account; to make it work (and to allow Drupal to generate stylesheets and files correctly), you have to manually log into the server and run `sudo chown -R www-data:www-data /var/www/drupalvm/drupal/sites/default/files` after initial provisioning is complete. + - You may need to manually create the `drupal_core_path` directory on the server at this time; it's not always created automatically due to permissions errors. + - The `files` folder that is generated during the initial Drupal installation is set to be owned by the admin account; to make it work (and to allow Drupal to generate stylesheets and files correctly), you have to manually log into the server and run the following two commands after provisioning is complete: + + ``` + $ sudo chown -R www-data /var/www/drupalvm/drupal/sites/default/files + $ sudo chmod -R 0700 /var/www/drupalvm/drupal/sites/default/files + ``` + - You can't synchronize folders between your host machine and DigitalOcean (at least not in any sane way); so you'll need to either have Drupal VM install a site from a given Drush make file or composer.json, or deploy your site yourself. - The way you build a production Drupal VM instance (vs. a local instance) is a little bit of a kludge. Follow https://github.com/geerlingguy/drupal-vm/issues/455 to track progress on a more streamlined process. - Drupal VM doesn't include any kind of backup system. You should use one if you have any kind of important data on your server! diff --git a/examples/prod/prod.overrides.yml b/examples/prod/prod.overrides.yml index d93b55a22..29b416a36 100644 --- a/examples/prod/prod.overrides.yml +++ b/examples/prod/prod.overrides.yml @@ -2,6 +2,14 @@ # Normally, this would be set to the hostname of your DigitalOcean Droplet. drupal_domain: "drupalvm.dev" +# Delete all the `apache_vhosts` or `nginx_hosts` you don't need. If only +# installing a single Drupal site, the variable should look like this (Apache): +apache_vhosts: + - servername: "{{ drupal_domain }}" + documentroot: "{{ drupal_core_path }}" + extra_parameters: | + ProxyPassMatch ^/(.*\.php(/.*)?)$ "fcgi://127.0.0.1:9000{{ drupal_core_path }}" + # Since this will be a publicly-accessible instance of Drupal VM, make sure you # configure secure passwords, especially for Drupal and MySQL! drupal_account_pass: admin diff --git a/provisioning/playbook.yml b/provisioning/playbook.yml index 8b6838fb3..d4e6318e4 100644 --- a/provisioning/playbook.yml +++ b/provisioning/playbook.yml @@ -78,7 +78,7 @@ - include: tasks/cron.yml - include: tasks/dashboard.yml - when: dashboard_install_dir is defined + when: dashboard_install_dir is defined and dashboard_install_dir != '' - name: Run configured post-provision shell scripts. script: "{{ item }}" From d16ba5c5cc51d89eb6b9443d7d04568f720e563b Mon Sep 17 00:00:00 2001 From: Jeff Geerling Date: Wed, 24 Feb 2016 15:58:12 -0600 Subject: [PATCH 0164/1273] Some simple updates to Quick Start Guide. --- README.md | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 21b90d26a..a75572eff 100644 --- a/README.md +++ b/README.md @@ -52,16 +52,17 @@ If you want to switch from Drupal 8 (default) to Drupal 7 or 6 on the initial in This Quick Start Guide will help you quickly build a Drupal 8 site on the Drupal VM using the included example Drush make file. You can also use the Drupal VM with a [Local Drupal codebase](http://docs.drupalvm.com/en/latest/deployment/local-codebase/) or even a [Drupal multisite installation](http://docs.drupalvm.com/en/latest/deployment/multisite/). -### 1 - Install dependencies (Vagrant) +### 1 - Install Vagrant Download and install [Vagrant](https://www.vagrantup.com/downloads.html). -- Vagrant will automatically install [VirtualBox](https://www.virtualbox.org/wiki/Downloads) if no providers are available (Drupal VM also works with Parallels or VMware, if you have the [Vagrant VMware integration plugin](http://www.vagrantup.com/vmware)). -Note for Faster Provisioning (Mac/Linux only): *[Install Ansible](http://docs.ansible.com/intro_installation.html) on your host machine, so Drupal VM can run the provisioning steps locally instead of inside the VM.* +Vagrant will automatically install [VirtualBox](https://www.virtualbox.org/wiki/Downloads) if no providers are available (Drupal VM also works with Parallels or VMware, if you have the [Vagrant VMware integration plugin](http://www.vagrantup.com/vmware)). -Note for Linux users: *If NFS is not already installed on your host, you will need to install it to use the default NFS synced folder configuration. See guides for [Debian/Ubuntu](https://www.digitalocean.com/community/tutorials/how-to-set-up-an-nfs-mount-on-ubuntu-14-04), [Arch](https://wiki.archlinux.org/index.php/NFS#Installation), and [RHEL/CentOS](https://www.digitalocean.com/community/tutorials/how-to-set-up-an-nfs-mount-on-centos-6).* +Notes: -Note on versions: *Please make sure you're running the latest stable version of Vagrant, VirtualBox, and Ansible, as the current version of Drupal VM is tested with the latest releases. As of February 2016: Vagrant 1.8.1, VirtualBox 5.0.14, and Ansible 2.0.0.* + - **For faster provisioning** (Mac/Linux only): *[Install Ansible](http://docs.ansible.com/intro_installation.html) on your host machine, so Drupal VM can run the provisioning steps locally instead of inside the VM.* + - **NFS on Linux**: *If NFS is not already installed on your host, you will need to install it to use the default NFS synced folder configuration. See guides for [Debian/Ubuntu](https://www.digitalocean.com/community/tutorials/how-to-set-up-an-nfs-mount-on-ubuntu-14-04), [Arch](https://wiki.archlinux.org/index.php/NFS#Installation), and [RHEL/CentOS](https://www.digitalocean.com/community/tutorials/how-to-set-up-an-nfs-mount-on-centos-6).* + - **Versions**: *Make sure you're running the latest releases of Vagrant, VirtualBox, and Ansible—as of February 2016, Drupal VM recommends: Vagrant 1.8.1, VirtualBox 5.0.14, and Ansible 2.0.0.* ### 2 - Build the Virtual Machine @@ -70,7 +71,7 @@ Note on versions: *Please make sure you're running the latest stable version of - Copy `example.drupal.make.yml` to `drupal.make.yml`. - Copy `example.config.yml` to `config.yml`. 3. Create a local directory where Drupal will be installed and configure the path to that directory in `config.yml` (`local_path`, inside `vagrant_synced_folders`). - 4. Open Terminal, cd to this directory (containing the `Vagrantfile` and this README file). + 4. Open Terminal, `cd` to this directory (containing the `Vagrantfile` and this README file). 5. (If you have Ansible installed on Mac/Linux) Run `$ sudo ansible-galaxy install -r provisioning/requirements.yml --force`. 6. Type in `vagrant up`, and let Vagrant do its magic. From 08a73eb968d457bfe62737f404e5b64c263bfcbd Mon Sep 17 00:00:00 2001 From: Jeff Geerling Date: Wed, 24 Feb 2016 21:42:16 -0600 Subject: [PATCH 0165/1273] Fixes #469: Flip the order of ip and hostname for hosts file in Dashboard. --- provisioning/templates/dashboard.html.j2 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/provisioning/templates/dashboard.html.j2 b/provisioning/templates/dashboard.html.j2 index 15fa52f9e..44d983da4 100644 --- a/provisioning/templates/dashboard.html.j2 +++ b/provisioning/templates/dashboard.html.j2 @@ -53,7 +53,7 @@ {% if drupalvm_webserver == 'apache' -%} {%- for host in apache_vhosts -%} {%- if host.documentroot != dashboard_install_dir -%} -
  • {{ host.servername }} {{ vagrant_ip }}
  • +
  • {{ vagrant_ip }} {{ host.servername }}
  • {%- endif -%} {% if host.serveralias is defined -%} {%- for alias in host.serveralias.split() -%} @@ -64,7 +64,7 @@ {%- elif drupalvm_webserver == 'nginx' -%} {%- for host in nginx_hosts -%} {%- if host.root != dashboard_install_dir -%} -
  • {{ host.server_name }} {{ vagrant_ip }}
  • +
  • {{ vagrant_ip }} {{ host.server_name }}
  • {%- endif -%} {%- endfor -%} {%- endif %} From 35f1a2bd20f5787762ac3e329a3e0bfbfc79671b Mon Sep 17 00:00:00 2001 From: Jeff Geerling Date: Thu, 25 Feb 2016 10:41:43 -0600 Subject: [PATCH 0166/1273] Issue #469: Fix failing tests. --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index edb277b5f..edc35739c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -94,7 +94,7 @@ script: - > sudo docker exec "$(cat ${container_id})" curl -s --header Host:${IP} localhost - | grep -q "
  • ${HOSTNAME} ${IP}
  • " + | grep -q "
  • ${IP} ${HOSTNAME}
  • " && (echo 'Dashboard install pass' && exit 0) || (echo 'Dashboard install fail' && exit 1) From 090f43afcac64bb6edfbaef631f730d88e62a1f0 Mon Sep 17 00:00:00 2001 From: Jeff Geerling Date: Thu, 25 Feb 2016 12:43:53 -0600 Subject: [PATCH 0167/1273] Issue #454: Clarify system requirements. --- README.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/README.md b/README.md index a75572eff..e327559ae 100644 --- a/README.md +++ b/README.md @@ -113,12 +113,10 @@ Drupal VM is built to integrate with every developer's workflow. Many guides for Drupal VM runs on almost any modern computer that can run VirtualBox and Vagrant, however for the best out-of-the-box experience, it's recommended you have a computer with at least: - - Intel Core i5, i7 or better processor + - Intel Core processor with VT-x enabled - At least 4 GB RAM (higher is better) - An SSD (for greater speed with synced folders) -If you have an older processor or a processor without VT-x virtualization support (e.g. the i3), you can still use Drupal VM, but you will need to switch the `vagrant_box` in `config.yml` to use a 3rd party 32-bit box, like `ubuntu/trusty32` or `hashicorp/precise32`. - ## Other Notes - To shut down the virtual machine, enter `vagrant halt` in the Terminal in the same folder that has the `Vagrantfile`. To destroy it completely (if you want to save a little disk space, or want to rebuild it from scratch with `vagrant up` again), type in `vagrant destroy`. From 99b7323e399ef897ebb1ecfaa6a676164e2120b5 Mon Sep 17 00:00:00 2001 From: Ferenc Nemeth Date: Fri, 26 Feb 2016 10:02:04 -0500 Subject: [PATCH 0168/1273] Ruby coding style fixes in Vagrantfile --- Vagrantfile | 64 +++++++++++++++++++++++++---------------------------- 1 file changed, 30 insertions(+), 34 deletions(-) diff --git a/Vagrantfile b/Vagrantfile index 216e4fcc2..b872b141f 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -1,17 +1,17 @@ # -*- mode: ruby -*- # vi: set ft=ruby : -VAGRANTFILE_API_VERSION = "2" +VAGRANTFILE_API_VERSION = '2' # Cross-platform way of finding an executable in the $PATH. def which(cmd) exts = ENV['PATHEXT'] ? ENV['PATHEXT'].split(';') : [''] ENV['PATH'].split(File::PATH_SEPARATOR).each do |path| - exts.each { |ext| + exts.each do |ext| exe = File.join(path, "#{cmd}#{ext}") return exe if File.executable?(exe) && !File.directory?(exe) - } + end end - return nil + nil end def walk(obj, &fn) @@ -20,37 +20,36 @@ def walk(obj, &fn) elsif obj.is_a?(Hash) obj.each_pair { |key, value| obj[key] = walk(value, &fn) } else - obj = fn.call(obj) + obj = yield(obj) end end # Use config.yml for basic VM configuration. require 'yaml' dir = File.dirname(File.expand_path(__FILE__)) -if !File.exist?("#{dir}/config.yml") +unless File.exist?("#{dir}/config.yml") raise 'Configuration file not found! Please copy example.config.yml to config.yml and try again.' end -vconfig = YAML::load_file("#{dir}/config.yml") +vconfig = YAML.load_file("#{dir}/config.yml") # Replace jinja variables in config. vconfig = walk(vconfig) do |value| while value.is_a?(String) && value.match(/{{ .* }}/) - value = value.gsub(/{{ (.*?) }}/) { |match| match = vconfig[$1] } + value = value.gsub(/{{ (.*?) }}/) { vconfig[Regexp.last_match(1)] } end value end Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| - # Networking configuration. config.vm.hostname = vconfig['vagrant_hostname'] - if vconfig['vagrant_ip'] == "0.0.0.0" && Vagrant.has_plugin?("vagrant-auto_network") - config.vm.network :private_network, :ip => vconfig['vagrant_ip'], :auto_network => true + if vconfig['vagrant_ip'] == '0.0.0.0' && Vagrant.has_plugin?('vagrant-auto_network') + config.vm.network :private_network, ip: vconfig['vagrant_ip'], auto_network: true else config.vm.network :private_network, ip: vconfig['vagrant_ip'] end - if !vconfig['vagrant_public_ip'].empty? && vconfig['vagrant_public_ip'] == "0.0.0.0" + if !vconfig['vagrant_public_ip'].empty? && vconfig['vagrant_public_ip'] == '0.0.0.0' config.vm.network :public_network elsif !vconfig['vagrant_public_ip'].empty? config.vm.network :public_network, ip: vconfig['vagrant_public_ip'] @@ -66,12 +65,12 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| # If a hostsfile manager plugin is installed, add all server names as aliases. aliases = [] blacklist = [config.vm.hostname, vconfig['vagrant_ip']] - if vconfig['drupalvm_webserver'] == "apache" + if vconfig['drupalvm_webserver'] == 'apache' vconfig['apache_vhosts'].each do |host| unless blacklist.include?(host['servername']) aliases.push(host['servername']) end - aliases.concat(host['serveralias'].split()) if host['serveralias'] + aliases.concat(host['serveralias'].split) if host['serveralias'] end else vconfig['nginx_hosts'].each do |host| @@ -81,43 +80,43 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| end end - if Vagrant.has_plugin?("vagrant-hostsupdater") + if Vagrant.has_plugin?('vagrant-hostsupdater') config.hostsupdater.aliases = aliases.uniq - elsif Vagrant.has_plugin?("vagrant-hostmanager") + elsif Vagrant.has_plugin?('vagrant-hostmanager') config.hostmanager.enabled = true config.hostmanager.manage_host = true config.hostmanager.aliases = aliases.uniq end # Synced folders. - for synced_folder in vconfig['vagrant_synced_folders']; + vconfig['vagrant_synced_folders'].each do |synced_folder| options = { type: synced_folder['type'], - rsync__auto: "true", + rsync__auto: 'true', rsync__exclude: synced_folder['excluded_paths'], - rsync__args: ["--verbose", "--archive", "--delete", "-z", "--chmod=ugo=rwX"], + rsync__args: ['--verbose', '--archive', '--delete', '-z', '--chmod=ugo=rwX'], id: synced_folder['id'], create: synced_folder.include?('create') ? synced_folder['create'] : false, mount_options: synced_folder.include?('mount_options') ? synced_folder['mount_options'] : [] } - if synced_folder.include?('options_override'); + if synced_folder.include?('options_override') options = options.merge(synced_folder['options_override']) end config.vm.synced_folder synced_folder['local_path'], synced_folder['destination'], options end # Allow override of the default synced folder type. - config.vm.synced_folder ".", "/vagrant", type: vconfig.include?('vagrant_synced_folder_default_type') ? vconfig['vagrant_synced_folder_default_type'] : 'nfs' + config.vm.synced_folder '.', '/vagrant', type: vconfig.include?('vagrant_synced_folder_default_type') ? vconfig['vagrant_synced_folder_default_type'] : 'nfs' # Provisioning. Use ansible if it's installed, JJG-Ansible-Windows if not. if which('ansible-playbook') - config.vm.provision "ansible" do |ansible| + config.vm.provision 'ansible' do |ansible| ansible.playbook = "#{dir}/provisioning/playbook.yml" end else - config.vm.provision "shell" do |sh| + config.vm.provision 'shell' do |sh| sh.path = "#{dir}/provisioning/JJG-Ansible-Windows/windows.sh" - sh.args = "/provisioning/playbook.yml" + sh.args = '/provisioning/playbook.yml' end end # ansible_local provisioner is broken in Vagrant < 1.8.2. @@ -131,11 +130,11 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| # VMware Fusion. config.vm.provider :vmware_fusion do |v, override| # HGFS kernel module currently doesn't load correctly for native shares. - override.vm.synced_folder ".", "/vagrant", type: 'nfs' + override.vm.synced_folder '.', '/vagrant', type: 'nfs' v.gui = false - v.vmx["memsize"] = vconfig['vagrant_memory'] - v.vmx["numvcpus"] = vconfig['vagrant_cpus'] + v.vmx['memsize'] = vconfig['vagrant_memory'] + v.vmx['numvcpus'] = vconfig['vagrant_cpus'] end # VirtualBox. @@ -144,8 +143,8 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| v.name = vconfig['vagrant_hostname'] v.memory = vconfig['vagrant_memory'] v.cpus = vconfig['vagrant_cpus'] - v.customize ["modifyvm", :id, "--natdnshostresolver1", "on"] - v.customize ["modifyvm", :id, "--ioapic", "on"] + v.customize ['modifyvm', :id, '--natdnshostresolver1', 'on'] + v.customize ['modifyvm', :id, '--ioapic', 'on'] end # Parallels. @@ -157,11 +156,8 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| end # Set the name of the VM. See: http://stackoverflow.com/a/17864388/100134 - config.vm.define vconfig['vagrant_machine_name'] do |d| - end + config.vm.define vconfig['vagrant_machine_name'] # Allow an untracked Vagrantfile to modify the configurations - if File.exist?('Vagrantfile.local') - eval File.read 'Vagrantfile.local' - end + eval File.read 'Vagrantfile.local' if File.exist?('Vagrantfile.local') end From 043918eba0ac1801599c97cc6672412840e0ed39 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oskar=20Sch=C3=B6ldstr=C3=B6m?= Date: Fri, 26 Feb 2016 10:10:12 -0500 Subject: [PATCH 0169/1273] Lint Vagrantfile on travis --- .travis.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.travis.yml b/.travis.yml index edc35739c..f620f595b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -32,6 +32,8 @@ before_install: - 'sudo docker pull ${distribution}:${version}' # Customize container - 'sudo docker build --rm=true --file=tests/Dockerfile.${distribution}-${version} --tag=${distribution}-${version}:ansible tests' + # Install lint tools. + - 'gem install rubocop' script: - container_id=$(mktemp) @@ -55,6 +57,9 @@ script: # Append additional variables if set. - '[[ $additional_vars ]] && sudo docker exec "$(cat ${container_id})" bash -c "cat /var/www/drupalvm/tests/${additional_vars} >> /var/www/drupalvm/config.yml" || true' + # Vagrantfile syntax check + - 'rubocop --except LineLength,Eval,MutableConstant' + # Ansible syntax check. - 'sudo docker exec --tty "$(cat ${container_id})" env TERM=xterm ansible-playbook /var/www/drupalvm/provisioning/playbook.yml --syntax-check' From 131f200b9a416faee3457ec43aba314aae8579e6 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 26 Feb 2016 10:50:55 -0500 Subject: [PATCH 0170/1273] Adding a note about the drush aliases NOT being valid for Windows by default. --- provisioning/templates/dashboard.html.j2 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/provisioning/templates/dashboard.html.j2 b/provisioning/templates/dashboard.html.j2 index 44d983da4..376a4202e 100644 --- a/provisioning/templates/dashboard.html.j2 +++ b/provisioning/templates/dashboard.html.j2 @@ -78,7 +78,7 @@
    {% if configure_local_drush_aliases -%} - + {%- endif %} @@ -91,6 +91,7 @@ {{ printSite(host.server_name, host.root) }} {%- endfor -%} {%- endif %} +
    Adminer{{ servername }}{{ servername() }} - Open + Open Documentation
    MailHog{{ servername }}{{ servername() }} - Open + Open Documentation
    PimpMyLog{{ servername }}{{ servername() }} - Open + Open Documentation
    Solr{{ servername }}{{ servername() }} - Open + Open Documentation
    XHProf{{ servername }}{{ servername() }} - Open + Open Documentation
    {{ servername }} {{ docroot }}Hostname Document RootDrush aliasDrush alias*
    *Note: Drush aliases are NOT created automatically on Windows. This is due to Ansible running from within the VM.
    {%- endmacro -%} From 5049189f249637f51a10e3c008f61d0812961495 Mon Sep 17 00:00:00 2001 From: Jeff Geerling Date: Fri, 26 Feb 2016 16:37:55 -0600 Subject: [PATCH 0171/1273] PR #473: Better wording for aliases without Ansible on host. --- provisioning/templates/dashboard.html.j2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/provisioning/templates/dashboard.html.j2 b/provisioning/templates/dashboard.html.j2 index 376a4202e..eeb0515bd 100644 --- a/provisioning/templates/dashboard.html.j2 +++ b/provisioning/templates/dashboard.html.j2 @@ -91,7 +91,7 @@ {{ printSite(host.server_name, host.root) }} {%- endfor -%} {%- endif %} - *Note: Drush aliases are NOT created automatically on Windows. This is due to Ansible running from within the VM. + *Note: On Windows or when you don't have Ansible installed on your host, Drush aliases are only created inside the VM. {%- endmacro -%} From 724ecacc5bc89660cdcf573bf8ea40f563afb1ef Mon Sep 17 00:00:00 2001 From: slimatic Date: Sat, 27 Feb 2016 08:08:30 -0500 Subject: [PATCH 0172/1273] Update scripts.md Corrected the wording for post provisioning scripts. Made it clearer to understand. --- docs/extras/scripts.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/extras/scripts.md b/docs/extras/scripts.md index 2b9d4fd5d..ae08e490f 100644 --- a/docs/extras/scripts.md +++ b/docs/extras/scripts.md @@ -7,7 +7,7 @@ post_provision_scripts: - "../scripts/post-provision.sh" ``` -The above example results in a `post-provision.sh` script running after the main Drupal VM setup is complete. Note that post provision scripts run _every_ time you the VM is provisioned provision the environment (e.g. when you run `vagrant up` or `vagrant provision`). +The above example results in a `post-provision.sh` script running after the main Drupal VM setup is complete. Note that post provision scripts run _every_ time you start the VM (`vagrant up`) or provision the environment (`vagrant provision`). You can define as many scripts as you would like, and any arguments after the path will be passed to the shell script itself (e.g. `"- "../scripts/setup-paths.sh --option"`). From 5e766621838f88d4938ad61c66981195a610cf87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oskar=20Sch=C3=B6ldstr=C3=B6m?= Date: Sat, 27 Feb 2016 15:47:31 -0500 Subject: [PATCH 0173/1273] Issue #479: Fix incorrect ip/name order for apache aliases in dashboard --- provisioning/templates/dashboard.html.j2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/provisioning/templates/dashboard.html.j2 b/provisioning/templates/dashboard.html.j2 index eeb0515bd..ab472a366 100644 --- a/provisioning/templates/dashboard.html.j2 +++ b/provisioning/templates/dashboard.html.j2 @@ -57,7 +57,7 @@ {%- endif -%} {% if host.serveralias is defined -%} {%- for alias in host.serveralias.split() -%} -
  • {{ alias }} {{ vagrant_ip }}
  • +
  • {{ vagrant_ip }} {{ alias }}
  • {%- endfor -%} {%- endif %} {%- endfor -%} From ec553232d37339432dc416a68c9b9db3bdc56887 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oskar=20Sch=C3=B6ldstr=C3=B6m?= Date: Sat, 27 Feb 2016 15:58:43 -0500 Subject: [PATCH 0174/1273] Support nginx aliases in dashboard, hostsupdater and drush aliases --- Vagrantfile | 15 +++++------ provisioning/templates/dashboard.html.j2 | 27 ++++++++++++++----- .../drupalvm-local.aliases.drushrc.php.j2 | 2 +- .../templates/drupalvm.aliases.drushrc.php.j2 | 2 +- 4 files changed, 28 insertions(+), 18 deletions(-) diff --git a/Vagrantfile b/Vagrantfile index b872b141f..9ef14ab6e 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -64,28 +64,25 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| # If a hostsfile manager plugin is installed, add all server names as aliases. aliases = [] - blacklist = [config.vm.hostname, vconfig['vagrant_ip']] if vconfig['drupalvm_webserver'] == 'apache' vconfig['apache_vhosts'].each do |host| - unless blacklist.include?(host['servername']) - aliases.push(host['servername']) - end + aliases.push(host['servername']) aliases.concat(host['serveralias'].split) if host['serveralias'] end else vconfig['nginx_hosts'].each do |host| - unless blacklist.include?(host['server_name']) - aliases.push(host['server_name']) - end + aliases.concat(host['server_name'].split) + aliases.concat(host['server_name_redirect'].split) if host['server_name_redirect'] end end + aliases = aliases.uniq - [config.vm.hostname, vconfig['vagrant_ip']] if Vagrant.has_plugin?('vagrant-hostsupdater') - config.hostsupdater.aliases = aliases.uniq + config.hostsupdater.aliases = aliases elsif Vagrant.has_plugin?('vagrant-hostmanager') config.hostmanager.enabled = true config.hostmanager.manage_host = true - config.hostmanager.aliases = aliases.uniq + config.hostmanager.aliases = aliases end # Synced folders. diff --git a/provisioning/templates/dashboard.html.j2 b/provisioning/templates/dashboard.html.j2 index ab472a366..194895896 100644 --- a/provisioning/templates/dashboard.html.j2 +++ b/provisioning/templates/dashboard.html.j2 @@ -48,24 +48,37 @@ {% endif %} {%- endmacro %} + {%- macro printHostsEntry(ip, servername) -%} + {%- if servername != ip -%} +
  • {{ ip }} {{ servername }}
  • + {%- endif -%} + {%- endmacro %} + {%- macro sectionHost() -%}
      {% if drupalvm_webserver == 'apache' -%} {%- for host in apache_vhosts -%} - {%- if host.documentroot != dashboard_install_dir -%} -
    • {{ vagrant_ip }} {{ host.servername }}
    • - {%- endif -%} + + {{ printHostsEntry(vagrant_ip, host.servername) }} {% if host.serveralias is defined -%} {%- for alias in host.serveralias.split() -%} -
    • {{ vagrant_ip }} {{ alias }}
    • + {{ printHostsEntry(vagrant_ip, alias) }} {%- endfor -%} {%- endif %} + {%- endfor -%} {%- elif drupalvm_webserver == 'nginx' -%} {%- for host in nginx_hosts -%} - {%- if host.root != dashboard_install_dir -%} -
    • {{ vagrant_ip }} {{ host.server_name }}
    • - {%- endif -%} + + {% for server_name in host.server_name.split(' ') -%} + {{ printHostsEntry(vagrant_ip, server_name) }} + {%- endfor %} + {% if host.server_name_redirect is defined -%} + {%- for server_name in host.server_name_redirect.split(' ') -%} + {{ printHostsEntry(vagrant_ip, server_name) }} + {%- endfor -%} + {%- endif %} + {%- endfor -%} {%- endif %}
    diff --git a/provisioning/templates/drupalvm-local.aliases.drushrc.php.j2 b/provisioning/templates/drupalvm-local.aliases.drushrc.php.j2 index 2881b49ec..9acb46a51 100644 --- a/provisioning/templates/drupalvm-local.aliases.drushrc.php.j2 +++ b/provisioning/templates/drupalvm-local.aliases.drushrc.php.j2 @@ -23,7 +23,7 @@ $aliases['{{ host }}'] = array( {%- elif drupalvm_webserver == 'nginx' -%} {%- for host in nginx_hosts -%} {%- if host.root not in _devtool_docroots -%} - {{ alias(host.server_name, host.root) }} + {{ alias(host.server_name.split(' ')[0], host.root) }} {%- endif -%} {%- endfor -%} {%- endif -%} diff --git a/provisioning/templates/drupalvm.aliases.drushrc.php.j2 b/provisioning/templates/drupalvm.aliases.drushrc.php.j2 index 88145c181..e534f0b74 100644 --- a/provisioning/templates/drupalvm.aliases.drushrc.php.j2 +++ b/provisioning/templates/drupalvm.aliases.drushrc.php.j2 @@ -26,7 +26,7 @@ $aliases['{{ host }}'] = array( {%- elif drupalvm_webserver == 'nginx' -%} {%- for host in nginx_hosts -%} {%- if host.root not in _devtool_docroots -%} - {{ alias(host.server_name, host.root) }} + {{ alias(host.server_name.split(' ')[0], host.root) }} {%- endif -%} {%- endfor -%} {%- endif -%} From 7796012ab1c95055f643f7e2e77b95381644ad9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oskar=20Sch=C3=B6ldstr=C3=B6m?= Date: Sun, 28 Feb 2016 22:17:47 -0500 Subject: [PATCH 0175/1273] fix nginx redirects not working when using aliases --- provisioning/templates/nginx-vhost.conf.j2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/provisioning/templates/nginx-vhost.conf.j2 b/provisioning/templates/nginx-vhost.conf.j2 index 60c4d8ed5..7f37bc349 100644 --- a/provisioning/templates/nginx-vhost.conf.j2 +++ b/provisioning/templates/nginx-vhost.conf.j2 @@ -2,7 +2,7 @@ server { listen 80; server_name {{ item.server_name_redirect }}; - return 301 http://{{ item.server_name }}$request_uri; + return 301 http://{{ item.server_name.split(' ')[0] }}$request_uri; } {% endif %} From cc54a3a9b346bedbecbbb3c40923d6e7dfbb43ad Mon Sep 17 00:00:00 2001 From: Jeff Geerling Date: Sun, 28 Feb 2016 21:42:29 -0600 Subject: [PATCH 0176/1273] PR #478 follow-up for exact scenario. --- docs/extras/scripts.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/extras/scripts.md b/docs/extras/scripts.md index ae08e490f..2ae9b6f29 100644 --- a/docs/extras/scripts.md +++ b/docs/extras/scripts.md @@ -7,7 +7,7 @@ post_provision_scripts: - "../scripts/post-provision.sh" ``` -The above example results in a `post-provision.sh` script running after the main Drupal VM setup is complete. Note that post provision scripts run _every_ time you start the VM (`vagrant up`) or provision the environment (`vagrant provision`). +The above example results in a `post-provision.sh` script running after the main Drupal VM setup is complete. Post provision scripts run after the first `vagrant up`, and then any time you run Vagrant provisioning (e.g. `vagrant provision` or `vagrant up --provision`). You can define as many scripts as you would like, and any arguments after the path will be passed to the shell script itself (e.g. `"- "../scripts/setup-paths.sh --option"`). From 6cf35ffcf088c2a7ec95f45e5f56c9774774246a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oskar=20Sch=C3=B6ldstr=C3=B6m?= Date: Sun, 28 Feb 2016 22:44:44 -0500 Subject: [PATCH 0177/1273] add drush aliases for webserver aliases to support multisite --- .../drupalvm-local.aliases.drushrc.php.j2 | 15 ++++++++++----- .../templates/drupalvm.aliases.drushrc.php.j2 | 15 ++++++++++----- 2 files changed, 20 insertions(+), 10 deletions(-) diff --git a/provisioning/templates/drupalvm-local.aliases.drushrc.php.j2 b/provisioning/templates/drupalvm-local.aliases.drushrc.php.j2 index 9acb46a51..a0d6ae238 100644 --- a/provisioning/templates/drupalvm-local.aliases.drushrc.php.j2 +++ b/provisioning/templates/drupalvm-local.aliases.drushrc.php.j2 @@ -7,23 +7,28 @@ */ {% macro alias(host, root) %} +{%- if root not in _devtool_docroots %} $aliases['{{ host }}'] = array( 'uri' => '{{ host }}', 'root' => '{{ root }}', ); +{% endif -%} {% endmacro %} {%- if drupalvm_webserver == 'apache' -%} {%- for vhost in apache_vhosts -%} - {%- if vhost.documentroot not in _devtool_docroots -%} - {{ alias(vhost.servername, vhost.documentroot) }} + {{ alias(vhost.servername, vhost.documentroot) }} + {%- if vhost.serveralias is defined -%} + {%- for serveralias in vhost.serveralias.split() -%} + {{ alias(serveralias, vhost.documentroot) }} + {%- endfor -%} {%- endif -%} {%- endfor -%} {%- elif drupalvm_webserver == 'nginx' -%} {%- for host in nginx_hosts -%} - {%- if host.root not in _devtool_docroots -%} - {{ alias(host.server_name.split(' ')[0], host.root) }} - {%- endif -%} + {%- for server_name in host.server_name.split() -%} + {{ alias(server_name, host.root) }} + {%- endfor -%} {%- endfor -%} {%- endif -%} diff --git a/provisioning/templates/drupalvm.aliases.drushrc.php.j2 b/provisioning/templates/drupalvm.aliases.drushrc.php.j2 index e534f0b74..bf9ff810d 100644 --- a/provisioning/templates/drupalvm.aliases.drushrc.php.j2 +++ b/provisioning/templates/drupalvm.aliases.drushrc.php.j2 @@ -7,6 +7,7 @@ */ {% macro alias(host, root) %} +{%- if root not in _devtool_docroots %} $aliases['{{ host }}'] = array( 'uri' => '{{ host }}', 'root' => '{{ root }}', @@ -15,18 +16,22 @@ $aliases['{{ host }}'] = array( 'ssh-options' => '-o PasswordAuthentication=no -i ~/.vagrant.d/insecure_private_key', ); +{% endif -%} {% endmacro %} {%- if drupalvm_webserver == 'apache' -%} {%- for vhost in apache_vhosts -%} - {%- if vhost.documentroot not in _devtool_docroots -%} - {{ alias(vhost.servername, vhost.documentroot) }} + {{ alias(vhost.servername, vhost.documentroot) }} + {%- if vhost.serveralias is defined -%} + {%- for serveralias in vhost.serveralias.split() -%} + {{ alias(serveralias, vhost.documentroot) }} + {%- endfor -%} {%- endif -%} {%- endfor -%} {%- elif drupalvm_webserver == 'nginx' -%} {%- for host in nginx_hosts -%} - {%- if host.root not in _devtool_docroots -%} - {{ alias(host.server_name.split(' ')[0], host.root) }} - {%- endif -%} + {%- for server_name in host.server_name.split() -%} + {{ alias(server_name, host.root) }} + {%- endfor -%} {%- endfor -%} {%- endif -%} From 4efd6540fdc2b1014809da00dd4428f824c857c1 Mon Sep 17 00:00:00 2001 From: Jeff Geerling Date: Sun, 28 Feb 2016 23:26:49 -0600 Subject: [PATCH 0178/1273] Fix deprecation warnings in Drupal VM tasks. --- provisioning/playbook.yml | 2 +- provisioning/tasks/cron.yml | 2 +- provisioning/tasks/extras.yml | 4 ++-- provisioning/tasks/www.yml | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/provisioning/playbook.yml b/provisioning/playbook.yml index d4e6318e4..1b7d3ab99 100644 --- a/provisioning/playbook.yml +++ b/provisioning/playbook.yml @@ -82,5 +82,5 @@ - name: Run configured post-provision shell scripts. script: "{{ item }}" - with_items: post_provision_scripts + with_items: "{{ post_provision_scripts }}" when: post_provision_scripts is defined diff --git a/provisioning/tasks/cron.yml b/provisioning/tasks/cron.yml index 4fdfdf8e5..5d3725650 100644 --- a/provisioning/tasks/cron.yml +++ b/provisioning/tasks/cron.yml @@ -9,5 +9,5 @@ month: "{{ item.month | default('*') }}" job: "{{ item.job }}" state: "{{ item.state | default('present') }}" - with_items: drupalvm_cron_jobs + with_items: "{{ drupalvm_cron_jobs }}" when: drupalvm_cron_jobs is defined diff --git a/provisioning/tasks/extras.yml b/provisioning/tasks/extras.yml index a7b7e7b74..b82c71f23 100644 --- a/provisioning/tasks/extras.yml +++ b/provisioning/tasks/extras.yml @@ -1,10 +1,10 @@ --- - name: Install extra apt packages (if any are configured). apt: "name={{ item }} state=installed" - with_items: extra_packages | list + with_items: "{{ extra_packages | list }}" when: ansible_os_family == 'Debian' and extra_packages | length - name: Install extra yum packages (if any are configured). yum: "name={{ item }} state=installed" - with_items: extra_packages | list + with_items: "{{ extra_packages | list }}" when: ansible_os_family == 'RedHat' and extra_packages | length diff --git a/provisioning/tasks/www.yml b/provisioning/tasks/www.yml index 775653b63..9e410c1cc 100644 --- a/provisioning/tasks/www.yml +++ b/provisioning/tasks/www.yml @@ -31,6 +31,6 @@ owner: root group: root mode: 0644 - with_items: nginx_hosts + with_items: "{{ nginx_hosts }}" notify: restart nginx when: drupalvm_webserver == 'nginx' From 812dcd02818dce37b9da907de5e35fe3882f051d Mon Sep 17 00:00:00 2001 From: Steve Purkiss Date: Tue, 1 Mar 2016 18:54:51 +0000 Subject: [PATCH 0179/1273] Update php-7.md requirements.txt->yml --- docs/other/php-7.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/other/php-7.md b/docs/other/php-7.md index 6ee43fe78..6dac51ed4 100644 --- a/docs/other/php-7.md +++ b/docs/other/php-7.md @@ -1,6 +1,6 @@ Drupal VM fully supports PHP 7, but currently defaults to 5.6 in order to maximize compatibility with older Drupal 6 and 7 sites. Soon, Drupal VM will change its defaults to install PHP 7.x instead of 5.x, but until then, follow the instructions below to use PHP 7. -_Note: If you have Ansible installed on your host machine, make sure you're running the latest version of all Ansible role dependencies by running `ansible-galaxy install -r provisioning/requirements.txt --force` inside the root Drupal VM project folder._ +_Note: If you have Ansible installed on your host machine, make sure you're running the latest version of all Ansible role dependencies by running `ansible-galaxy install -r provisioning/requirements.yml --force` inside the root Drupal VM project folder._ ## Ubuntu 14.04 From 1bcc3d0aefeca7f4e45e5412ec2e3e41e9e7a77b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oskar=20Sch=C3=B6ldstr=C3=B6m?= Date: Tue, 1 Mar 2016 16:22:44 -0500 Subject: [PATCH 0180/1273] Fix centos tests failing due to galaxy bug --- tests/Dockerfile.centos-7 | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/Dockerfile.centos-7 b/tests/Dockerfile.centos-7 index b3259e736..3cbb03045 100644 --- a/tests/Dockerfile.centos-7 +++ b/tests/Dockerfile.centos-7 @@ -14,13 +14,17 @@ rm -f /lib/systemd/system/anaconda.target.wants/*; # Install Ansible RUN yum -y install epel-release -RUN yum -y install git ansible sudo which curl tar unzip xz logrotate initscripts +RUN yum -y install git sudo which curl tar unzip xz logrotate initscripts +RUN yum -y install python-setuptools gcc sudo libffi-devel python-devel openssl-devel RUN yum clean all +RUN easy_install pip +RUN pip install ansible # Disable requiretty RUN sed -i -e 's/^\(Defaults\s*requiretty\)/#--- \1/' /etc/sudoers # Install Ansible inventory file +RUN mkdir -p /etc/ansible RUN echo -e '[local]\nlocalhost ansible_connection=local' > /etc/ansible/hosts VOLUME ["/sys/fs/cgroup"] From 65575ed488bbe9b90983e82cbe0f246344cd74df Mon Sep 17 00:00:00 2001 From: Thom Toogood Date: Wed, 2 Mar 2016 18:57:58 +1100 Subject: [PATCH 0181/1273] Updated PHP7 PPA. --- provisioning/tasks/init-debian.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/provisioning/tasks/init-debian.yml b/provisioning/tasks/init-debian.yml index 14735b49d..b705971ac 100644 --- a/provisioning/tasks/init-debian.yml +++ b/provisioning/tasks/init-debian.yml @@ -22,7 +22,7 @@ when: php_version == "5.6" - name: Add repository for PHP 7.0. - apt_repository: repo='ppa:ondrej/php-7.0' + apt_repository: repo='ppa:ondrej/php' when: php_version == "7.0" - name: Define php_xhprof_html_dir. From 4f2d0f9ecb09fb5061fcf46dd708b44d3f6b170f Mon Sep 17 00:00:00 2001 From: Jeff Geerling Date: Wed, 2 Mar 2016 10:38:45 -0600 Subject: [PATCH 0182/1273] PR #492 follow-up and Fixes #491: Update docs and add php7.0-xml for Ubuntu. --- docs/other/php-7.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/other/php-7.md b/docs/other/php-7.md index 6dac51ed4..3270e58ec 100644 --- a/docs/other/php-7.md +++ b/docs/other/php-7.md @@ -19,6 +19,7 @@ php_packages: - php7.0-imap - php7.0-json - php7.0-opcache + - php7.0-xml php_mysql_package: php7.0-mysql php_fpm_daemon: php7.0-fpm php_fpm_pool_conf_path: "/etc/php/7.0/fpm/pool.d/www.conf" From 0946a7cf4b93b3ddf761285d4d07d7dc80afa873 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oskar=20Sch=C3=B6ldstr=C3=B6m?= Date: Thu, 3 Mar 2016 23:16:39 -0500 Subject: [PATCH 0183/1273] Fixes #495: Set composer owner to vagrant user --- example.config.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/example.config.yml b/example.config.yml index b4e407b42..38f42301c 100644 --- a/example.config.yml +++ b/example.config.yml @@ -216,7 +216,9 @@ php_enable_php_fpm: true php_fpm_listen: "127.0.0.1:9000" composer_path: /usr/bin/composer -composer_home_path: '/home/vagrant/.composer' +composer_home_path: "/home/{{ vagrant_user }}/.composer" +composer_home_owner: "{{ vagrant_user }}" +composer_home_group: "{{ vagrant_user }}" # composer_global_packages: # - { name: phpunit/phpunit, release: '@stable' } From 7060d7e5d4ce21707604e9bd1380e024015e435b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oskar=20Sch=C3=B6ldstr=C3=B6m?= Date: Thu, 3 Mar 2016 23:34:39 -0500 Subject: [PATCH 0184/1273] Fix incorrect gems/composer user when installing with ansible directly --- example.config.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/example.config.yml b/example.config.yml index 38f42301c..65077598c 100644 --- a/example.config.yml +++ b/example.config.yml @@ -174,7 +174,7 @@ nodejs_version: "0.12" nodejs_npm_global_packages: [] # `ruby` must be in installed_extras for this to work. -ruby_install_gems_user: "{{ vagrant_user }}" +ruby_install_gems_user: "{{ ansible_ssh_user }}" ruby_install_gems: [] # You can configure almost anything else on the server in the rest of this file. @@ -216,9 +216,9 @@ php_enable_php_fpm: true php_fpm_listen: "127.0.0.1:9000" composer_path: /usr/bin/composer -composer_home_path: "/home/{{ vagrant_user }}/.composer" -composer_home_owner: "{{ vagrant_user }}" -composer_home_group: "{{ vagrant_user }}" +composer_home_path: "/home/{{ ansible_ssh_user }}/.composer" +composer_home_owner: "{{ ansible_ssh_user }}" +composer_home_group: "{{ ansible_ssh_user }}" # composer_global_packages: # - { name: phpunit/phpunit, release: '@stable' } From 160787715f457fc1d27414143896967d27af8517 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oskar=20Sch=C3=B6ldstr=C3=B6m?= Date: Fri, 4 Mar 2016 13:38:19 -0500 Subject: [PATCH 0185/1273] fix incorrect user when installing locally --- .travis.yml | 3 ++- example.config.yml | 8 ++++---- provisioning/vars/main.yml | 2 ++ tests/test-vars.yml | 1 + 4 files changed, 9 insertions(+), 5 deletions(-) create mode 100644 tests/test-vars.yml diff --git a/.travis.yml b/.travis.yml index f620f595b..e42e246f4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -54,7 +54,8 @@ script: - 'sudo docker exec "$(cat ${container_id})" cp /var/www/drupalvm/$CONFIG /var/www/drupalvm/config.yml' - 'sudo docker exec "$(cat ${container_id})" cp /var/www/drupalvm/$MAKEFILE /var/www/drupalvm/drupal.make.yml' - # Append additional variables if set. + # Append additional variables. + - 'sudo docker exec "$(cat ${container_id})" bash -c "cat /var/www/drupalvm/tests/test-vars.yml >> /var/www/drupalvm/config.yml" || true' - '[[ $additional_vars ]] && sudo docker exec "$(cat ${container_id})" bash -c "cat /var/www/drupalvm/tests/${additional_vars} >> /var/www/drupalvm/config.yml" || true' # Vagrantfile syntax check diff --git a/example.config.yml b/example.config.yml index 65077598c..3affc9e40 100644 --- a/example.config.yml +++ b/example.config.yml @@ -174,7 +174,7 @@ nodejs_version: "0.12" nodejs_npm_global_packages: [] # `ruby` must be in installed_extras for this to work. -ruby_install_gems_user: "{{ ansible_ssh_user }}" +ruby_install_gems_user: "{{ drupalvm_user }}" ruby_install_gems: [] # You can configure almost anything else on the server in the rest of this file. @@ -216,9 +216,9 @@ php_enable_php_fpm: true php_fpm_listen: "127.0.0.1:9000" composer_path: /usr/bin/composer -composer_home_path: "/home/{{ ansible_ssh_user }}/.composer" -composer_home_owner: "{{ ansible_ssh_user }}" -composer_home_group: "{{ ansible_ssh_user }}" +composer_home_path: "/home/{{ drupalvm_user }}/.composer" +composer_home_owner: "{{ drupalvm_user }}" +composer_home_group: "{{ drupalvm_user }}" # composer_global_packages: # - { name: phpunit/phpunit, release: '@stable' } diff --git a/provisioning/vars/main.yml b/provisioning/vars/main.yml index 905659ad0..6f2ea140e 100644 --- a/provisioning/vars/main.yml +++ b/provisioning/vars/main.yml @@ -4,3 +4,5 @@ _devtool_docroots: - "{{ pimpmylog_install_dir }}" - "{{ php_xhprof_html_dir }}" - "{{ dashboard_install_dir|default('') }}" + +drupalvm_user: "{{ ansible_ssh_user | default(ansible_env.SUDO_USER, true) | default(ansible_env.USER, true) | default(ansible_user_id) }}" diff --git a/tests/test-vars.yml b/tests/test-vars.yml new file mode 100644 index 000000000..3c765fddb --- /dev/null +++ b/tests/test-vars.yml @@ -0,0 +1 @@ +composer_home_path: "/{{ drupalvm_user }}/.composer" From 9ada7ab8c5e6731c7c8362a9e09ad65fc5142308 Mon Sep 17 00:00:00 2001 From: Jeff Geerling Date: Sat, 5 Mar 2016 17:18:19 -0600 Subject: [PATCH 0186/1273] Update PHP 7.0 docs to include mbstring extension. --- docs/other/php-7.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/other/php-7.md b/docs/other/php-7.md index 3270e58ec..457d5a153 100644 --- a/docs/other/php-7.md +++ b/docs/other/php-7.md @@ -20,6 +20,7 @@ php_packages: - php7.0-json - php7.0-opcache - php7.0-xml + - php7.0-mbstring php_mysql_package: php7.0-mysql php_fpm_daemon: php7.0-fpm php_fpm_pool_conf_path: "/etc/php/7.0/fpm/pool.d/www.conf" From 1fd29267125e2750fd100f9159939ee3401c0c80 Mon Sep 17 00:00:00 2001 From: Jeff Geerling Date: Thu, 10 Mar 2016 10:24:47 -0600 Subject: [PATCH 0187/1273] Update default Drupal core branch to 8.1.x. --- example.drupal.make.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/example.drupal.make.yml b/example.drupal.make.yml index 8c564b851..8f705de48 100644 --- a/example.drupal.make.yml +++ b/example.drupal.make.yml @@ -14,7 +14,7 @@ projects: type: "core" download: # Drupal core branch (e.g. "6.x", "7.x", "8.0.x"). - branch: "8.0.x" + branch: "8.1.x" working-copy: true # Other modules. From 0cc7868e69d64a13c70f7ccfb4ba4e8aee71157e Mon Sep 17 00:00:00 2001 From: Jean Valverde Date: Tue, 15 Mar 2016 11:18:51 +0100 Subject: [PATCH 0188/1273] Update windows.md Add Windows Winnfsd information and vagrant-winnfsd fork suggestion. --- docs/other/windows.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/docs/other/windows.md b/docs/other/windows.md index d54e5bdc4..e3238e41f 100644 --- a/docs/other/windows.md +++ b/docs/other/windows.md @@ -44,6 +44,27 @@ You can use the [vagrant-winnfsd](https://github.com/GM-Alex/vagrant-winnfsd) pl Another option for the more adventurous is to manually install and configure WinNFSD, and manually mount the shares within your VM. This requires a bit more work, but could be more stable on Windows; see this blog post for more details: [Windows + Vagrant + WinNFSD without file update problems](https://hollyit.net/blog/windowsvagrantwinnfsd-without-file-update-problems). +There is a fork of vagrant-winnfsd that add logging and debug https://github.com/GuyPaddock/vagrant-winnfsd, replace in your .vagrant.d\gems\gems folder to test it. + +The best config is to mount only one folder with nfs see [vagrant-winnfsd issue #12](https://github.com/winnfsd/vagrant-winnfsd/issues/12#issuecomment-78195957), so you need to adapt your config and set vagrant folder to native: + + vagrant_synced_folder_default_type: "" + +Add mount_options to your synced folder to avoid an error: + + type: nfs + mount_options: ["rw","vers=3","udp","nolock"] + +In your Vagrantfile.local, add user access to vagrant: + + config.winnfsd.uid=900 + config.winnfsd.gid=900 + +If you are using the fork of vagrant-winnfsd, you can set aditionnal options and use logging="on" in case of problem in your Vagrantfile.local: + + config.winnfsd.logging="off" + config.winnfsd.halt_on_reload="on" + ### "Authentication failure" on vagrant up Some Windows users have reported running into an issue where an authentication failure is reported once the VM is booted (e.g. `drupalvm: Warning: Authentication failure. Retrying...` — see [#170](https://github.com/geerlingguy/drupal-vm/issues/170)). To fix this, do the following: From 187825e2ecd832e8593fc82797454d25a3161159 Mon Sep 17 00:00:00 2001 From: Jeff Geerling Date: Thu, 17 Mar 2016 12:33:43 -0500 Subject: [PATCH 0189/1273] Fixes #515: Install drupal with Drush fails due to 8.1.x composer install requirement. --- .gitignore | 1 + provisioning/tasks/build-makefile.yml | 12 ++++++++++++ 2 files changed, 13 insertions(+) diff --git a/.gitignore b/.gitignore index c864bfad7..3958f643a 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,7 @@ .project/ .vagrant/ .bundle/ +*.retry vagrant_ansible_inventory_default config.yml drupal.make.yml diff --git a/provisioning/tasks/build-makefile.yml b/provisioning/tasks/build-makefile.yml index 0c503acd2..c74c9ce6f 100644 --- a/provisioning/tasks/build-makefile.yml +++ b/provisioning/tasks/build-makefile.yml @@ -20,3 +20,15 @@ chdir={{ drupal_core_path }} when: drupal_site.stat.exists == false become: no + +- name: Check if a composer.json file is present. + stat: "path={{ drupal_core_path }}/composer.json" + register: drupal_core_composer_file + when: drupal_site.stat.exists == false + +- name: Run composer install if composer.json is present. + command: > + composer install + chdir={{ drupal_core_path }} + when: drupal_site.stat.exists == false and drupal_core_composer_file.stat.exists == true + become: no From f9ed87f146c46518df82d0964a1821f177a79eb1 Mon Sep 17 00:00:00 2001 From: Jeff Geerling Date: Thu, 17 Mar 2016 14:08:18 -0500 Subject: [PATCH 0190/1273] Fixes #499: Allow Drupal VM to work on Debian base boxes. --- docs/other/base-os.md | 2 ++ provisioning/tasks/init-debian.yml | 7 ++++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/docs/other/base-os.md b/docs/other/base-os.md index 623888819..17ff0b4f9 100644 --- a/docs/other/base-os.md +++ b/docs/other/base-os.md @@ -9,6 +9,8 @@ Currently-supported OSes are: For certain OSes, there are a couple other caveats and tweaks you may need to perform to get things running smoothly—the main features and latest development is only guaranteed to work with the default OS as configured in `example.config.yml`. +Some other OSes should work, but are not regularly tested with Drupal VM, including Debian 8/Jessie (`debian/jessie64`) and Debian 7/Wheezy (`debian/wheezy64`). + ## RedHat Enterprise Linux / CentOS 7 **MySQL/MariaDB**: RHEL/CentOS 7 switched from using MySQL as the default database system to using MariaDB, so to make sure everything is configured properly, you need to add the following to `config.yml` so MariaDB installs correctly: diff --git a/provisioning/tasks/init-debian.yml b/provisioning/tasks/init-debian.yml index b705971ac..02b4d8a06 100644 --- a/provisioning/tasks/init-debian.yml +++ b/provisioning/tasks/init-debian.yml @@ -12,18 +12,19 @@ - name: Disable the ufw firewall (since we use a simple iptables firewall). service: name=ufw state=stopped + when: ansible_distribution == "Ubuntu" - name: Add repository for PHP 5.5. apt_repository: repo='ppa:ondrej/php5' - when: php_version == "5.5" + when: php_version == "5.5" and ansible_distribution == "Ubuntu" - name: Add repository for PHP 5.6. apt_repository: repo='ppa:ondrej/php5-5.6' - when: php_version == "5.6" + when: php_version == "5.6" and ansible_distribution == "Ubuntu" - name: Add repository for PHP 7.0. apt_repository: repo='ppa:ondrej/php' - when: php_version == "7.0" + when: php_version == "7.0" and ansible_distribution == "Ubuntu" - name: Define php_xhprof_html_dir. set_fact: From d93a31d245048eb8e22ef10c7f8c1b2d0e8d8d1a Mon Sep 17 00:00:00 2001 From: Jeff Geerling Date: Thu, 17 Mar 2016 16:29:51 -0500 Subject: [PATCH 0191/1273] Expand documentation around the XHProf module. --- docs/extras/xhprof.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/extras/xhprof.md b/docs/extras/xhprof.md index 74d724881..972a49201 100644 --- a/docs/extras/xhprof.md +++ b/docs/extras/xhprof.md @@ -6,7 +6,9 @@ As a prerequisite, make sure you have `xhprof` in the `installed_extras` list in The easiest way to use XHProf to profile your PHP code on a Drupal site is to install the [XHProf](https://www.drupal.org/project/xhprof) module, then in XHProf's configuration (at `/admin/config/development/xhprof`), check the 'Enable profiling of page views and drush requests' checkbox. -The XHProf module doesn't yet include support for callgraphs, but there's an issue to [add callgraph support](https://www.drupal.org/node/1470740). +The XHProf module doesn't include built-in support for callgraphs, but there's an issue to [add callgraph support](https://www.drupal.org/node/1470740). + +You can view callgraphs (and a listing of all stored runs) using Drupal VM's own XHProf installation by visiting `http://xhprof.drupalvm.dev/` and clicking on the relevant run, then clicking the "[View Full Callgraph]" link. ## Devel module (deprecated) From d9a56d8867683f2fb013b0c8f3415beba79172b2 Mon Sep 17 00:00:00 2001 From: Jeff Geerling Date: Sun, 20 Mar 2016 20:42:14 -0500 Subject: [PATCH 0192/1273] Fixes #519: Ensure Parallels guest tools are installed and up to date. --- Vagrantfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Vagrantfile b/Vagrantfile index 9ef14ab6e..e68861320 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -150,6 +150,7 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| p.name = vconfig['vagrant_hostname'] p.memory = vconfig['vagrant_memory'] p.cpus = vconfig['vagrant_cpus'] + p.update_guest_tools = true end # Set the name of the VM. See: http://stackoverflow.com/a/17864388/100134 From 6081d58e7b09032f53833ac6aa695625d588a5d9 Mon Sep 17 00:00:00 2001 From: Jeff Geerling Date: Mon, 21 Mar 2016 16:01:50 -0500 Subject: [PATCH 0193/1273] Issue #397: Add basic Varnish cache tag support with BANs. --- provisioning/templates/drupalvm.vcl.j2 | 31 ++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/provisioning/templates/drupalvm.vcl.j2 b/provisioning/templates/drupalvm.vcl.j2 index 29ede513f..6125d1f78 100644 --- a/provisioning/templates/drupalvm.vcl.j2 +++ b/provisioning/templates/drupalvm.vcl.j2 @@ -34,6 +34,26 @@ sub vcl_recv { return (hash); } + # Only allow BAN requests from IP addresses in the 'purge' ACL. + if (req.method == "BAN") { + # Same ACL check as above: + if (!client.ip ~ purge) { + return (synth(403, "Not allowed.")); + } + + # Logic for the ban, using the X-Drupal-Cache-Tags header. For more info + # read through https://github.com/geerlingguy/drupal-vm/issues/397. + if (req.http.X-Drupal-Cache-Tags) { + ban("obj.http.X-Drupal-Cache-Tags ~ " + req.http.X-Drupal-Cache-Tags); + } + else { + return (synth(403, "X-Drupal-Cache-Tags header missing.")); + } + + # Throw a synthetic page so the request won't go to the backend. + return (synth(200, "Ban added.")); + } + # Only cache GET and HEAD requests (pass through POST requests). if (req.method != "GET" && req.method != "HEAD") { return (pass); @@ -90,6 +110,13 @@ sub vcl_recv { # Set a header to track a cache HITs and MISSes. sub vcl_deliver { + # Remove ban-lurker friendly custom headers when delivering to client. + unset resp.http.X-Url; + unset resp.http.X-Host; + # Uncomment on production (when not debugging). + # unset resp.http.X-Drupal-Cache-Tags; + # unset resp.http.X-Drupal-Cache-Contexts; + if (obj.hits > 0) { set resp.http.X-Varnish-Cache = "HIT"; } @@ -100,6 +127,10 @@ sub vcl_deliver { # Instruct Varnish what to do in the case of certain backend responses (beresp). sub vcl_backend_response { + # Set ban-lurker friendly custom headers. + set beresp.http.X-Url = bereq.url; + set beresp.http.X-Host = bereq.http.host; + # Cache 404s, 301s, at 500s with a short lifetime to protect the backend. if (beresp.status == 404 || beresp.status == 301 || beresp.status == 500) { set beresp.ttl = 10m; From f7e708db80a392d5d53863191f5af8e5dd273c3f Mon Sep 17 00:00:00 2001 From: Jeff Geerling Date: Mon, 21 Mar 2016 22:47:30 -0500 Subject: [PATCH 0194/1273] Issue #397: Use X-Cache-Tags instead of X-Drupal-Cache-Tags for BANs. --- provisioning/templates/drupalvm.vcl.j2 | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/provisioning/templates/drupalvm.vcl.j2 b/provisioning/templates/drupalvm.vcl.j2 index 6125d1f78..93e27341c 100644 --- a/provisioning/templates/drupalvm.vcl.j2 +++ b/provisioning/templates/drupalvm.vcl.j2 @@ -41,13 +41,13 @@ sub vcl_recv { return (synth(403, "Not allowed.")); } - # Logic for the ban, using the X-Drupal-Cache-Tags header. For more info - # read through https://github.com/geerlingguy/drupal-vm/issues/397. - if (req.http.X-Drupal-Cache-Tags) { - ban("obj.http.X-Drupal-Cache-Tags ~ " + req.http.X-Drupal-Cache-Tags); + # Logic for the ban, using the X-Cache-Tags header. For more info, see + # https://github.com/geerlingguy/drupal-vm/issues/397. + if (req.http.X-Cache-Tags) { + ban("obj.http.X-Cache-Tags ~ " + req.http.X-Cache-Tags); } else { - return (synth(403, "X-Drupal-Cache-Tags header missing.")); + return (synth(403, "X-Cache-Tags header missing.")); } # Throw a synthetic page so the request won't go to the backend. @@ -114,8 +114,7 @@ sub vcl_deliver { unset resp.http.X-Url; unset resp.http.X-Host; # Uncomment on production (when not debugging). - # unset resp.http.X-Drupal-Cache-Tags; - # unset resp.http.X-Drupal-Cache-Contexts; + # unset resp.http.X-Cache-Tags; if (obj.hits > 0) { set resp.http.X-Varnish-Cache = "HIT"; From 9754228e7e934c4f6c1f9d62a7160873836f883b Mon Sep 17 00:00:00 2001 From: Jeff Geerling Date: Tue, 22 Mar 2016 10:44:40 -0500 Subject: [PATCH 0195/1273] Fixes #397: Add cache tag support to default Varnish config. --- provisioning/templates/drupalvm.vcl.j2 | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/provisioning/templates/drupalvm.vcl.j2 b/provisioning/templates/drupalvm.vcl.j2 index 93e27341c..e515d2a65 100644 --- a/provisioning/templates/drupalvm.vcl.j2 +++ b/provisioning/templates/drupalvm.vcl.j2 @@ -41,13 +41,13 @@ sub vcl_recv { return (synth(403, "Not allowed.")); } - # Logic for the ban, using the X-Cache-Tags header. For more info, see - # https://github.com/geerlingguy/drupal-vm/issues/397. - if (req.http.X-Cache-Tags) { - ban("obj.http.X-Cache-Tags ~ " + req.http.X-Cache-Tags); + # Logic for the ban, using the X-Drupal-Cache-Tags header. For more info + # see https://github.com/geerlingguy/drupal-vm/issues/397. + if (req.http.X-Drupal-Cache-Tags) { + ban("obj.http.X-Drupal-Cache-Tags ~ " + req.http.X-Drupal-Cache-Tags); } else { - return (synth(403, "X-Cache-Tags header missing.")); + return (synth(403, "X-Drupal-Cache-Tags header missing.")); } # Throw a synthetic page so the request won't go to the backend. @@ -113,8 +113,9 @@ sub vcl_deliver { # Remove ban-lurker friendly custom headers when delivering to client. unset resp.http.X-Url; unset resp.http.X-Host; - # Uncomment on production (when not debugging). - # unset resp.http.X-Cache-Tags; + # Comment these for easier Drupal cache tag debugging in development. + unset resp.http.X-Drupal-Cache-Tags; + unset resp.http.X-Drupal-Cache-Contexts; if (obj.hits > 0) { set resp.http.X-Varnish-Cache = "HIT"; From 22832033a2eae0ab6deee74238a736e2d1934294 Mon Sep 17 00:00:00 2001 From: Jean Valverde Date: Thu, 24 Mar 2016 18:41:10 +1300 Subject: [PATCH 0196/1273] Update windows.md Update my poor english sentence! --- docs/other/windows.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/other/windows.md b/docs/other/windows.md index e3238e41f..42373784e 100644 --- a/docs/other/windows.md +++ b/docs/other/windows.md @@ -44,7 +44,7 @@ You can use the [vagrant-winnfsd](https://github.com/GM-Alex/vagrant-winnfsd) pl Another option for the more adventurous is to manually install and configure WinNFSD, and manually mount the shares within your VM. This requires a bit more work, but could be more stable on Windows; see this blog post for more details: [Windows + Vagrant + WinNFSD without file update problems](https://hollyit.net/blog/windowsvagrantwinnfsd-without-file-update-problems). -There is a fork of vagrant-winnfsd that add logging and debug https://github.com/GuyPaddock/vagrant-winnfsd, replace in your .vagrant.d\gems\gems folder to test it. +GuyPaddock's fork of [vagrant-winnfsd](https://github.com/GuyPaddock/vagrant-winnfsd) adds logging and debug messages. You can replace the vagrant-winnfsd gem inside .vagrant.d\gems\gems to use it instead. The best config is to mount only one folder with nfs see [vagrant-winnfsd issue #12](https://github.com/winnfsd/vagrant-winnfsd/issues/12#issuecomment-78195957), so you need to adapt your config and set vagrant folder to native: From 0c0671023030e7e0d4fdf039354505af8b4c7c94 Mon Sep 17 00:00:00 2001 From: Jeff Geerling Date: Thu, 24 Mar 2016 12:35:55 -0500 Subject: [PATCH 0197/1273] Fixes #529: Use Purge-Cache-Tags instead of X-Drupal-Cache-Tags for Varnish tags. --- provisioning/templates/drupalvm.vcl.j2 | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/provisioning/templates/drupalvm.vcl.j2 b/provisioning/templates/drupalvm.vcl.j2 index e515d2a65..8b5f76e93 100644 --- a/provisioning/templates/drupalvm.vcl.j2 +++ b/provisioning/templates/drupalvm.vcl.j2 @@ -41,13 +41,13 @@ sub vcl_recv { return (synth(403, "Not allowed.")); } - # Logic for the ban, using the X-Drupal-Cache-Tags header. For more info + # Logic for the ban, using the Purge-Cache-Tags header. For more info # see https://github.com/geerlingguy/drupal-vm/issues/397. - if (req.http.X-Drupal-Cache-Tags) { - ban("obj.http.X-Drupal-Cache-Tags ~ " + req.http.X-Drupal-Cache-Tags); + if (req.http.Purge-Cache-Tags) { + ban("obj.http.Purge-Cache-Tags ~ " + req.http.Purge-Cache-Tags); } else { - return (synth(403, "X-Drupal-Cache-Tags header missing.")); + return (synth(403, "Purge-Cache-Tags header missing.")); } # Throw a synthetic page so the request won't go to the backend. @@ -113,9 +113,7 @@ sub vcl_deliver { # Remove ban-lurker friendly custom headers when delivering to client. unset resp.http.X-Url; unset resp.http.X-Host; - # Comment these for easier Drupal cache tag debugging in development. - unset resp.http.X-Drupal-Cache-Tags; - unset resp.http.X-Drupal-Cache-Contexts; + unset resp.http.Purge-Cache-Tags; if (obj.hits > 0) { set resp.http.X-Varnish-Cache = "HIT"; From 2bc896658adc94a92de9ac917bca780341b98642 Mon Sep 17 00:00:00 2001 From: Jeff Geerling Date: Sat, 26 Mar 2016 12:08:44 -0500 Subject: [PATCH 0198/1273] Issue #527: Add Varnish support for BigPipe streaming. --- provisioning/templates/drupalvm.vcl.j2 | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/provisioning/templates/drupalvm.vcl.j2 b/provisioning/templates/drupalvm.vcl.j2 index 8b5f76e93..90400c4ff 100644 --- a/provisioning/templates/drupalvm.vcl.j2 +++ b/provisioning/templates/drupalvm.vcl.j2 @@ -134,6 +134,12 @@ sub vcl_backend_response { set beresp.ttl = 10m; } + # Enable streaming directly to backend for BigPipe responses. + if (beresp.http.Surrogate-Control ~ "BigPipe/1.0") { + set beresp.do_stream = true; + set beresp.ttl = 0s; + } + # Don't allow static files to set cookies. # (?i) denotes case insensitive in PCRE (perl compatible regular expressions). # This list of extensions appears twice, once here and again in vcl_recv so From 4ed1eda0db7f501caadd1e56307f419344746484 Mon Sep 17 00:00:00 2001 From: Jeff Geerling Date: Mon, 28 Mar 2016 20:50:00 -0400 Subject: [PATCH 0199/1273] Fixes #531: Use stable official Nginx release instead of system package. --- example.config.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/example.config.yml b/example.config.yml index 3affc9e40..6948db62f 100644 --- a/example.config.yml +++ b/example.config.yml @@ -133,6 +133,7 @@ nginx_hosts: root: "{{ dashboard_install_dir }}" nginx_remove_default_vhost: true +nginx_ppa_use: true # MySQL Databases and users. If build_makefile: is true, first database will # be used for the makefile-built site. From d116204f6f18bd03809d9f9448892e4adf71c0c3 Mon Sep 17 00:00:00 2001 From: Jeff Geerling Date: Mon, 28 Mar 2016 22:13:47 -0400 Subject: [PATCH 0200/1273] Fixes #527: Support BigPipe streaming in Drupal VM - Varnish VCL and docs update. --- docs/other/bigpipe.md | 35 +++++++++++++++++++++++++++++++++++ mkdocs.yml | 1 + 2 files changed, 36 insertions(+) create mode 100644 docs/other/bigpipe.md diff --git a/docs/other/bigpipe.md b/docs/other/bigpipe.md new file mode 100644 index 000000000..9ab3af9f1 --- /dev/null +++ b/docs/other/bigpipe.md @@ -0,0 +1,35 @@ +[BigPipe](https://www.drupal.org/documentation/modules/big_pipe) is a Drupal module that was added as an 'experimental' module in Drupal 8.1. BigPipe allows PHP responses to be streamed in-progress so authenticated end users can recieve a cached response very quickly, with placeholders for more dynamic (harder to cache) content that are filled in during the same request. + +To do this, BigPipe requires an environment configured to allow the authenticated request response to be streamed from PHP all the way through to the client. All parts of the web stack that intermediate the connection have to have output buffering disabled so the response stream can flow through. + +Drupal VM's default configuration uses Apache's `mod_proxy_fastcgi` module, which doesn't allow output buffering to be disabled, so to use BigPipe with Drupal VM, you will need to either switch to Nginx or make a few modifications to the Apache configuration. + +Drupal VM's Varnish configuration works with BigPipe out of the box, as it allows the backend response to be streamed whenever BigPipe is enabled (it outputs a `Surrogate-Control: BigPipe/1.0` header to tell Varnish when to stream the response). + +## PHP configuration + +BigPipe requires PHP's output buffering to be disabled. To do this, add the following line to `config.yml` with the other PHP configuration settings: + + php_output_buffering: "Off" + +(You also need to make sure `zlib.output_compression` is `Off`—but that's the default, so you shouldn't need to change anything else in the PHP configuration). + +## Nginx configuration + +There is no extra configuration required to get BigPipe working with Nginx. + +Nginx is the recommended way to use BigPipe, for the following reasons: + + - It's easier to configure Nginx to handle hundreds (or more) concurrent connections through to PHP-FPM than `mod_php`, and more widely used than the other compatible Apache CGI modules `mod_fcgid` and `mod_fastcgi` + - Nginx intelligently disables output buffering and gzip if the `X-Accel-Buffering: no` header is present (BigPipe sets this header automatically). This means gzip and buffering can be enabled for most requests, and disabled on-the-fly by BigPipe. + +## Apache configuration + +There are a few ways you can configure Apache to work with a streamed response, but Drupal VM's default configuration uses `mod_proxy_fastcgi`, which is incompatible with BigPipe. + +If you don't want to use Nginx (which requires no special configuration), you can switch Apache to use `mod_php` by making the following changes in `config.yml`: + + 1. Add `libapache2-mod-php5` to `extra_packages` in `config.yml`. + 2. Delete the `extra_parameters` under any Drupal site in the list of `apache_vhosts` (so there is no `ProxyPassMatch` rule). + +You can also disable PHP-FPM and remove the two `proxy` entries from `apache_mods_enabled` if you don't want to use PHP-FPM with Apache at all, but that's optional; it won't break anything to run Apache with `mod_php` and `mod_proxy_fastcgi` at the same time. diff --git a/mkdocs.yml b/mkdocs.yml index bd0beaceb..797d5d2e6 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -35,6 +35,7 @@ pages: - 'Using Different Webservers': 'other/webservers.md' - 'Using a local Vagrantfile': 'other/local-vagrantfile.md' - 'PHP 7 on Drupal VM': 'other/php-7.md' + - 'BigPipe with Drupal VM': 'other/bigpipe.md' - 'Drupal VM Management Tools': 'other/management-tools.md' - 'Networking Notes': 'other/networking.md' - 'Drupal 6 Notes': 'other/drupal-6.md' From 2264d6e07f13bf58ba564112c01373fc78a1c790 Mon Sep 17 00:00:00 2001 From: Jeff Geerling Date: Tue, 29 Mar 2016 18:14:09 -0400 Subject: [PATCH 0201/1273] Fixes #532: Clean up BigPipe documentation for Apache and Nginx. --- docs/other/bigpipe.md | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/docs/other/bigpipe.md b/docs/other/bigpipe.md index 9ab3af9f1..84cd09659 100644 --- a/docs/other/bigpipe.md +++ b/docs/other/bigpipe.md @@ -2,17 +2,13 @@ To do this, BigPipe requires an environment configured to allow the authenticated request response to be streamed from PHP all the way through to the client. All parts of the web stack that intermediate the connection have to have output buffering disabled so the response stream can flow through. -Drupal VM's default configuration uses Apache's `mod_proxy_fastcgi` module, which doesn't allow output buffering to be disabled, so to use BigPipe with Drupal VM, you will need to either switch to Nginx or make a few modifications to the Apache configuration. +Drupal VM's default configuration uses Apache with the `mod_proxy_fastcgi` module to connect to PHP-FPM, which isn't the most optimal configuration for BigPipe, and requires gzip compression to be disabled, so you should either switch to Nginx or consider further customizing the Apache configuration. Drupal VM's Varnish configuration works with BigPipe out of the box, as it allows the backend response to be streamed whenever BigPipe is enabled (it outputs a `Surrogate-Control: BigPipe/1.0` header to tell Varnish when to stream the response). ## PHP configuration -BigPipe requires PHP's output buffering to be disabled. To do this, add the following line to `config.yml` with the other PHP configuration settings: - - php_output_buffering: "Off" - -(You also need to make sure `zlib.output_compression` is `Off`—but that's the default, so you shouldn't need to change anything else in the PHP configuration). +BigPipe doesn't require any particular modifications to PHP in Drupal VM's default configuration. However, for some test scenarios, you can disable php's `output_buffering` entirely by setting `php_output_buffering: "Off"` in `config.yml`. ## Nginx configuration @@ -25,9 +21,17 @@ Nginx is the recommended way to use BigPipe, for the following reasons: ## Apache configuration -There are a few ways you can configure Apache to work with a streamed response, but Drupal VM's default configuration uses `mod_proxy_fastcgi`, which is incompatible with BigPipe. +Apache has three primary means of interacting with PHP applications like Drupal: `mod_php`, `mod_fastcgi`, and `mod_proxy_fcgi`. Drupal VM uses `mod_proxy_fcgi`, which is the most widely used and supported method of using Apache with PHP-FPM for the best scalability and memory management with Apache + PHP. + +For all of these methods, you have to make sure `mod_deflate` gzip compression is disabled; you can do this by adding the following line immediately after the `ProxyPassMatch` line under a host in the `apache_vhosts` list inside `config.yml`: + + SetEnv no-gzip 1 + +This will disable the `mod_deflate` module for any requests inside that directory. + +> Even without gzip, `mod_proxy_fcgi` buffers responses in a minimum of 4096-byte chunks. Most BigPipe usage deals with chunks of content larger than that, but if you're testing PHP's output buffering and notice that Apache delivers the entire page at once instead of flushing output immediately, you might be running into this buffer. See [this issue](https://github.com/geerlingguy/drupal-vm/issues/532#issuecomment-203128163) for more information. -If you don't want to use Nginx (which requires no special configuration), you can switch Apache to use `mod_php` by making the following changes in `config.yml`: +If you want to switch Apache to use `mod_php` instead of proxying requests through PHP-FPM, you can make the following changes in `config.yml`: 1. Add `libapache2-mod-php5` to `extra_packages` in `config.yml`. 2. Delete the `extra_parameters` under any Drupal site in the list of `apache_vhosts` (so there is no `ProxyPassMatch` rule). From 45480a840f2d775fc4f4d23926215fd32a39ec56 Mon Sep 17 00:00:00 2001 From: Jeff Geerling Date: Wed, 30 Mar 2016 22:40:23 -0400 Subject: [PATCH 0202/1273] Issue #532: Clean up BigPipe docs further. --- docs/other/bigpipe.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/docs/other/bigpipe.md b/docs/other/bigpipe.md index 84cd09659..82315dfd5 100644 --- a/docs/other/bigpipe.md +++ b/docs/other/bigpipe.md @@ -8,7 +8,7 @@ Drupal VM's Varnish configuration works with BigPipe out of the box, as it allow ## PHP configuration -BigPipe doesn't require any particular modifications to PHP in Drupal VM's default configuration. However, for some test scenarios, you can disable php's `output_buffering` entirely by setting `php_output_buffering: "Off"` in `config.yml`. +BigPipe doesn't require any particular modifications to PHP in Drupal VM's default configuration. However, for some scenarios, you might want to disable php's `output_buffering` entirely by setting `php_output_buffering: "Off"` in `config.yml`, or change the `output_buffering` level from it's default of `4096` bytes. ## Nginx configuration @@ -29,8 +29,6 @@ For all of these methods, you have to make sure `mod_deflate` gzip compression i This will disable the `mod_deflate` module for any requests inside that directory. -> Even without gzip, `mod_proxy_fcgi` buffers responses in a minimum of 4096-byte chunks. Most BigPipe usage deals with chunks of content larger than that, but if you're testing PHP's output buffering and notice that Apache delivers the entire page at once instead of flushing output immediately, you might be running into this buffer. See [this issue](https://github.com/geerlingguy/drupal-vm/issues/532#issuecomment-203128163) for more information. - If you want to switch Apache to use `mod_php` instead of proxying requests through PHP-FPM, you can make the following changes in `config.yml`: 1. Add `libapache2-mod-php5` to `extra_packages` in `config.yml`. From ff65a2eaad7fdd78669e51c19d43d7e92af90d00 Mon Sep 17 00:00:00 2001 From: Nate Haug Date: Fri, 1 Apr 2016 19:53:13 -0700 Subject: [PATCH 0203/1273] Issue #540: Clarify PHP 7 requirements. --- example.config.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/example.config.yml b/example.config.yml index 6948db62f..ad1c61a67 100644 --- a/example.config.yml +++ b/example.config.yml @@ -199,6 +199,8 @@ firewall_allowed_tcp_ports: firewall_log_dropped_packets: false # PHP Configuration. Currently-supported versions: 5.5, 5.6, 7.0. +# PHP 7.0 requires a few additional changes. See the documentation at +# http://docs.drupalvm.com/en/latest/other/php-7/ php_version: "5.6" php_memory_limit: "192M" php_display_errors: "On" From fd162438d6d1d8fe26d886f07b3d952dc95f7ad7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oskar=20Sch=C3=B6ldstr=C3=B6m?= Date: Thu, 7 Apr 2016 14:47:32 -0500 Subject: [PATCH 0204/1273] Issue #550: Make unzip a dependency --- example.config.yml | 3 +-- provisioning/tasks/init-debian.yml | 1 + provisioning/tasks/init-redhat.yml | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/example.config.yml b/example.config.yml index ad1c61a67..d3083e0a0 100644 --- a/example.config.yml +++ b/example.config.yml @@ -166,8 +166,7 @@ installed_extras: - xhprof # Add any extra apt or yum packages you would like installed. -extra_packages: - - unzip +extra_packages: [] # `nodejs` must be in installed_extras for this to work. Valid examples: "0.10", # "0.12", "4.x", "5.x". diff --git a/provisioning/tasks/init-debian.yml b/provisioning/tasks/init-debian.yml index 02b4d8a06..a57a059ac 100644 --- a/provisioning/tasks/init-debian.yml +++ b/provisioning/tasks/init-debian.yml @@ -9,6 +9,7 @@ - python-apt - python-pycurl - build-essential + - unzip - name: Disable the ufw firewall (since we use a simple iptables firewall). service: name=ufw state=stopped diff --git a/provisioning/tasks/init-redhat.yml b/provisioning/tasks/init-redhat.yml index 2c45a511b..387a02353 100644 --- a/provisioning/tasks/init-redhat.yml +++ b/provisioning/tasks/init-redhat.yml @@ -5,6 +5,7 @@ - "curl" - "python-pycurl" - "@development" + - "unzip" - name: Enable remi repo for MySQL. set_fact: mysql_enablerepo="remi" From c58c2d8481acc266f224f02f418a2c728c2e3e15 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oskar=20Sch=C3=B6ldstr=C3=B6m?= Date: Thu, 7 Apr 2016 17:13:35 -0500 Subject: [PATCH 0205/1273] Fix drush core-rsync not expanding ~ to $HOME --- provisioning/templates/drupalvm.aliases.drushrc.php.j2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/provisioning/templates/drupalvm.aliases.drushrc.php.j2 b/provisioning/templates/drupalvm.aliases.drushrc.php.j2 index bf9ff810d..cc9249bf6 100644 --- a/provisioning/templates/drupalvm.aliases.drushrc.php.j2 +++ b/provisioning/templates/drupalvm.aliases.drushrc.php.j2 @@ -13,7 +13,7 @@ $aliases['{{ host }}'] = array( 'root' => '{{ root }}', 'remote-host' => '{{ host }}', 'remote-user' => '{{ vagrant_user }}', - 'ssh-options' => '-o PasswordAuthentication=no -i ~/.vagrant.d/insecure_private_key', + 'ssh-options' => '-o PasswordAuthentication=no -i ' . drush_server_home() . '/.vagrant.d/insecure_private_key', ); {% endif -%} From ca349e2a83ca25703ebc47bf68fe8d8de5c98486 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oskar=20Sch=C3=B6ldstr=C3=B6m?= Date: Sat, 9 Apr 2016 12:01:44 -0500 Subject: [PATCH 0206/1273] Issue #406: Add docs about sql-sync workaround for older drush versions [ci skip] --- docs/deployment/local-codebase.md | 2 +- docs/extras/drush.md | 14 +++++++++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/docs/deployment/local-codebase.md b/docs/deployment/local-codebase.md index d8f85c2b1..71c8f7d4e 100644 --- a/docs/deployment/local-codebase.md +++ b/docs/deployment/local-codebase.md @@ -41,4 +41,4 @@ If you have your Drupal site configured to use a special database and/or user/pa ## Build the VM, import your database -Run `vagrant up` to build the VM with your codebase synced into the proper location. Once the VM is created, you can [connect to the MySQL database](../extras/mysql.md) and import your site's database to the Drupal VM, or use a command like `drush sql-sync` to copy a database from another server. +Run `vagrant up` to build the VM with your codebase synced into the proper location. Once the VM is created, you can [connect to the MySQL database](../extras/mysql.md) and import your site's database to the Drupal VM, or use a [command like `drush sql-sync`](../extras/drush.md#using-sql-sync) to copy a database from another server. diff --git a/docs/extras/drush.md b/docs/extras/drush.md index e29d6c0c3..85b6abea5 100644 --- a/docs/extras/drush.md +++ b/docs/extras/drush.md @@ -35,4 +35,16 @@ $ drush @drupalvm.dev status Drupal VM automatically generates a drush alias file in `~/.drush/drupalvm.aliases.drushrc.php` with an alias for every site you have defined in the `apache_vhosts` variable. -You can disable Drupal VM's automatic Drush alias file management if you want to manage drush aliases on your own. Just set the `configure_local_drush_aliases` variable in `config.yml` to `false`. \ No newline at end of file +You can disable Drupal VM's automatic Drush alias file management if you want to manage drush aliases on your own. Just set the `configure_local_drush_aliases` variable in `config.yml` to `false`. + +## Using sql-sync + +For sql-sync to work between two remotes make sure you are running Drush 8.0.3 or later on your host and your guest machine, as well as 7.1.0 or later on the remote. + +If you're locked to an older version of Drush, it is likely that Drush will try to run the command from the `@destination` instead of from your host computer, which means you need to move your `@remote` alias to Drupal VM as well. You can place the file in any of the [directories that drush searches](https://github.com/drush-ops/drush/blob/5a1328d6e9cb919a286e70360df159d1b4b15d3e/examples/example.aliases.drushrc.php#L43:L51), for example `/home/vagrant/.drush/.aliases.drushrc.php`. + +If you're still having issues, you can avoid `sql-sync` entirely and simply pipe the mysqldump output yourself with: + +``` +drush @remote sql-dump | drush @durpalvm.drupalvm.dev sql-cli +``` From 88375d594b292d77289e6c65f1edd73116d635d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oskar=20Sch=C3=B6ldstr=C3=B6m?= Date: Sat, 9 Apr 2016 15:32:01 -0500 Subject: [PATCH 0207/1273] Fixes #530: Add docs for arch linux where python 3 is the default [ci skip] --- docs/other/linux.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/docs/other/linux.md b/docs/other/linux.md index 843dc975a..9ab7fd61d 100644 --- a/docs/other/linux.md +++ b/docs/other/linux.md @@ -29,6 +29,14 @@ In this case, you need to install your system's appropriate kernel module, and y Periodically, when you upgrade your system's Linux kernel, you might need to run steps 2 and 3 above again, or you can uninstall and reinstall VirtualBox (e.g. `sudo dnf remove VirtualBox && sudo dnf install VirtualBox`). +### Arch Linux + +Arch Linux uses Python 3 as the default while Ansible requires Python 2. To get around parse errors you need to specify that the `python2` binary should be used instead of the default `python`. Add the following to your `config.yml`: + +``` +ansible_python_interpreter: "/usr/bin/env python2" +``` + ## Synced Folders Most issues have to do synced folders. These are the most common ones: From 1cdea04d1dc6fd59617300bb71244ed4986a04ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oskar=20Sch=C3=B6ldstr=C3=B6m?= Date: Sat, 9 Apr 2016 15:59:39 -0500 Subject: [PATCH 0208/1273] Fixes #424: Fix NPM packages being installed under root user --- example.config.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/example.config.yml b/example.config.yml index d3083e0a0..ceebd40cf 100644 --- a/example.config.yml +++ b/example.config.yml @@ -172,6 +172,7 @@ extra_packages: [] # "0.12", "4.x", "5.x". nodejs_version: "0.12" nodejs_npm_global_packages: [] +nodejs_install_npm_user: "{{ drupalvm_user }}" # `ruby` must be in installed_extras for this to work. ruby_install_gems_user: "{{ drupalvm_user }}" From e304e4ae946af10e92e10a7dcd0fd302eb12db5a Mon Sep 17 00:00:00 2001 From: Iain Houston Date: Sun, 10 Apr 2016 20:30:29 +0100 Subject: [PATCH 0209/1273] Update php-7.md The main change is to document the `php_conf_paths` and `php_extension_conf_paths` you need to get `php.ini` settings etc into the right directories. Also added a note to say that Xdebug 2.4.0 works with PHP7.0 ... but this would depend upon another pull request I made for `ansible-role-php-xdebug` --- docs/other/php-7.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/docs/other/php-7.md b/docs/other/php-7.md index 457d5a153..51ff4c673 100644 --- a/docs/other/php-7.md +++ b/docs/other/php-7.md @@ -23,11 +23,21 @@ php_packages: - php7.0-mbstring php_mysql_package: php7.0-mysql php_fpm_daemon: php7.0-fpm +php_conf_paths: + - /etc/php/7.0/fpm + - /etc/php/7.0/apache2 + - /etc/php/7.0/cli +php_extension_conf_paths: + - /etc/php/7.0/fpm/conf.d + - /etc/php/7.0/apache2/conf.d + - /etc/php/7.0/cli/conf.d php_fpm_pool_conf_path: "/etc/php/7.0/fpm/pool.d/www.conf" ``` Also, comment out `xhprof`, `xdebug`, `redis` and `memcached` from the `installed_extras` list, as these extensions are not yet supported for PHP 7 (as of late 2015). +Xdebug 2.4.0 works with PHP 7.0. Sources available at https://xdebug.org/files/xdebug-2.4.0.tgz but you'll need to update `ansible-role-php-xdebug` to pick the source from there. + You can also build from source using the same/included `geerlingguy.php` Ansible role, but that process is a bit more involved and for power users comfortable with the process. ## RedHat/CentOS 7 From 349b84e375e870f3c02fc2696aca729aff232794 Mon Sep 17 00:00:00 2001 From: Jeff Geerling Date: Sun, 10 Apr 2016 22:18:02 -0500 Subject: [PATCH 0210/1273] PR #556 grammar/spellcheck fixes. --- docs/extras/drush.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/extras/drush.md b/docs/extras/drush.md index 85b6abea5..9aabd7cb7 100644 --- a/docs/extras/drush.md +++ b/docs/extras/drush.md @@ -41,10 +41,10 @@ You can disable Drupal VM's automatic Drush alias file management if you want to For sql-sync to work between two remotes make sure you are running Drush 8.0.3 or later on your host and your guest machine, as well as 7.1.0 or later on the remote. -If you're locked to an older version of Drush, it is likely that Drush will try to run the command from the `@destination` instead of from your host computer, which means you need to move your `@remote` alias to Drupal VM as well. You can place the file in any of the [directories that drush searches](https://github.com/drush-ops/drush/blob/5a1328d6e9cb919a286e70360df159d1b4b15d3e/examples/example.aliases.drushrc.php#L43:L51), for example `/home/vagrant/.drush/.aliases.drushrc.php`. +If you're locked to an older version of Drush, it is likely that Drush will try to run the command from the `@destination` instead of from your host computer, which means you need to move your `@remote` alias to Drupal VM as well. You can place the file in any of the [directories Drush searches](https://github.com/drush-ops/drush/blob/5a1328d6e9cb919a286e70360df159d1b4b15d3e/examples/example.aliases.drushrc.php#L43:L51), for example `/home/vagrant/.drush/.aliases.drushrc.php`. -If you're still having issues, you can avoid `sql-sync` entirely and simply pipe the mysqldump output yourself with: +If you're still having issues, you can avoid `sql-sync` entirely and pipe the mysqldump output yourself with: ``` -drush @remote sql-dump | drush @durpalvm.drupalvm.dev sql-cli +drush @remote sql-dump | drush @drupalvm.drupalvm.dev sql-cli ``` From 2a1b864f9c531458f4414d5aec4f5fbc43e659be Mon Sep 17 00:00:00 2001 From: Iain Houston Date: Mon, 11 Apr 2016 08:30:37 +0100 Subject: [PATCH 0211/1273] Remove redundant comment re Xdebug 2.4.0 --- docs/other/php-7.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/docs/other/php-7.md b/docs/other/php-7.md index 51ff4c673..3ba122295 100644 --- a/docs/other/php-7.md +++ b/docs/other/php-7.md @@ -36,8 +36,6 @@ php_fpm_pool_conf_path: "/etc/php/7.0/fpm/pool.d/www.conf" Also, comment out `xhprof`, `xdebug`, `redis` and `memcached` from the `installed_extras` list, as these extensions are not yet supported for PHP 7 (as of late 2015). -Xdebug 2.4.0 works with PHP 7.0. Sources available at https://xdebug.org/files/xdebug-2.4.0.tgz but you'll need to update `ansible-role-php-xdebug` to pick the source from there. - You can also build from source using the same/included `geerlingguy.php` Ansible role, but that process is a bit more involved and for power users comfortable with the process. ## RedHat/CentOS 7 From ad5792da978192e18f8c836b74200d937113c94b Mon Sep 17 00:00:00 2001 From: Iain Houston Date: Mon, 11 Apr 2016 09:08:35 +0100 Subject: [PATCH 0212/1273] OK to use Xdebug 2.4.0 with PHP 7.0 --- docs/other/php-7.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/other/php-7.md b/docs/other/php-7.md index 3ba122295..77b0a5503 100644 --- a/docs/other/php-7.md +++ b/docs/other/php-7.md @@ -34,7 +34,7 @@ php_extension_conf_paths: php_fpm_pool_conf_path: "/etc/php/7.0/fpm/pool.d/www.conf" ``` -Also, comment out `xhprof`, `xdebug`, `redis` and `memcached` from the `installed_extras` list, as these extensions are not yet supported for PHP 7 (as of late 2015). +Also, comment out `xhprof`, `redis` and `memcached` from the `installed_extras` list, as these extensions are not yet supported for PHP 7 (as of late 2015). You can also build from source using the same/included `geerlingguy.php` Ansible role, but that process is a bit more involved and for power users comfortable with the process. From 71bac517ec7aebba46f7f66981585a69c789e999 Mon Sep 17 00:00:00 2001 From: Jeff Geerling Date: Mon, 11 Apr 2016 09:54:35 -0500 Subject: [PATCH 0213/1273] Fix trailing space from PR #560. --- docs/other/php-7.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/other/php-7.md b/docs/other/php-7.md index 77b0a5503..5a185895f 100644 --- a/docs/other/php-7.md +++ b/docs/other/php-7.md @@ -23,7 +23,7 @@ php_packages: - php7.0-mbstring php_mysql_package: php7.0-mysql php_fpm_daemon: php7.0-fpm -php_conf_paths: +php_conf_paths: - /etc/php/7.0/fpm - /etc/php/7.0/apache2 - /etc/php/7.0/cli From 641ca2f132d65d1b55980b5331c9626184e11601 Mon Sep 17 00:00:00 2001 From: Jeff Geerling Date: Tue, 12 Apr 2016 10:07:26 -0500 Subject: [PATCH 0214/1273] Issue #562: Update JJG-Ansible-Windows to fix pip install. --- provisioning/JJG-Ansible-Windows/LICENSE | 0 provisioning/JJG-Ansible-Windows/README.md | 0 provisioning/JJG-Ansible-Windows/windows.sh | 29 +++++++++++++++------ 3 files changed, 21 insertions(+), 8 deletions(-) mode change 100755 => 100644 provisioning/JJG-Ansible-Windows/LICENSE mode change 100755 => 100644 provisioning/JJG-Ansible-Windows/README.md mode change 100755 => 100644 provisioning/JJG-Ansible-Windows/windows.sh diff --git a/provisioning/JJG-Ansible-Windows/LICENSE b/provisioning/JJG-Ansible-Windows/LICENSE old mode 100755 new mode 100644 diff --git a/provisioning/JJG-Ansible-Windows/README.md b/provisioning/JJG-Ansible-Windows/README.md old mode 100755 new mode 100644 diff --git a/provisioning/JJG-Ansible-Windows/windows.sh b/provisioning/JJG-Ansible-Windows/windows.sh old mode 100755 new mode 100644 index c8a375af0..728b63cd5 --- a/provisioning/JJG-Ansible-Windows/windows.sh +++ b/provisioning/JJG-Ansible-Windows/windows.sh @@ -9,6 +9,23 @@ # Uncomment if behind a proxy server. # export {http,https,ftp}_proxy='http://username:password@proxy-host:80' +args=() +extra_vars=("is_windows=true") + +# Process and remove all flags. +while (($#)); do + case $1 in + --extra-vars=*) extra_vars+=("${1#*=}") ;; + --extra-vars|-e) shift; extra_vars+=("$1") ;; + -*) echo "invalid option: $1" >&2; exit 1 ;; + *) args+=("$1") ;; + esac + shift +done + +# Restore the arguments without flags. +set -- "${args[@]}" + ANSIBLE_PLAYBOOK=$1 PLAYBOOK_DIR=${ANSIBLE_PLAYBOOK%/*} @@ -35,13 +52,9 @@ if ! command -v ansible >/dev/null; then exit 1; fi - echo "Installing pip via easy_install." - wget https://raw.githubusercontent.com/ActiveState/ez_setup/v0.9/ez_setup.py - python ez_setup.py && rm -f ez_setup.py - easy_install pip - - # Make sure setuptools are installed crrectly. - pip install setuptools --no-use-wheel --upgrade + echo "Installing pip." + wget https://bootstrap.pypa.io/get-pip.py + python get-pip.py && rm -f get-pip.py # Install GCC / required build tools. if [[ ! -z $YUM ]]; then @@ -63,4 +76,4 @@ find "/vagrant/$PLAYBOOK_DIR" \( -name "requirements.yml" -o -name "requirements # Run the playbook. echo "Running Ansible provisioner defined in Vagrantfile." -ansible-playbook -i 'localhost,' "/vagrant/${ANSIBLE_PLAYBOOK}" --extra-vars "is_windows=true" --connection=local +ansible-playbook -i 'localhost,' "/vagrant/${ANSIBLE_PLAYBOOK}" --extra-vars "${extra_vars[*]}" --connection=local From 542de12a0e662816a704273dde8a7c6a295c9af1 Mon Sep 17 00:00:00 2001 From: Jeff Geerling Date: Fri, 22 Apr 2016 15:30:52 -0500 Subject: [PATCH 0215/1273] Fixes #573: Support Ubuntu 16.04 LTS Xenial. --- docs/other/base-os.md | 14 ++++++++++++++ example.config.yml | 2 +- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/docs/other/base-os.md b/docs/other/base-os.md index 17ff0b4f9..d796baaf2 100644 --- a/docs/other/base-os.md +++ b/docs/other/base-os.md @@ -2,6 +2,7 @@ Drupal VM's configuration is designed to work with RedHat and Debian-compatible Currently-supported OSes are: + - Ubuntu 16.04 - Ubuntu 14.04 (default) - Ubuntu 12.04 - RedHat Enterprise Linux / CentOS 7 @@ -11,6 +12,19 @@ For certain OSes, there are a couple other caveats and tweaks you may need to pe Some other OSes should work, but are not regularly tested with Drupal VM, including Debian 8/Jessie (`debian/jessie64`) and Debian 7/Wheezy (`debian/wheezy64`). +## Ubuntu 16.04 Xenial LTS + +Ubuntu 16.04 is the latest LTS release, and there are a few changes currently required to make sure Drupal VM runs smoothly on it. Note also that Ubuntu 16.04 defaults to PHP 7; older versions of PHP will not be supported on this OS. + +**Redis**: If using redis, add the line `php_redis_package: php-redis` to `config.yml` before provisioning. + +Installed extras that are currently unsupported on Ubuntu 16.04: + + - `memcached` + - `selenium` + - `varnish` + - `xhprof` + ## RedHat Enterprise Linux / CentOS 7 **MySQL/MariaDB**: RHEL/CentOS 7 switched from using MySQL as the default database system to using MariaDB, so to make sure everything is configured properly, you need to add the following to `config.yml` so MariaDB installs correctly: diff --git a/example.config.yml b/example.config.yml index ceebd40cf..c744738a4 100644 --- a/example.config.yml +++ b/example.config.yml @@ -1,6 +1,6 @@ --- # `vagrant_box` can also be set to geerlingguy/centos6, geerlingguy/centos7, -# geerlingguy/ubuntu1204, parallels/ubuntu-14.04, etc. +# geerlingguy/ubuntu1604, geerlingguy/ubuntu1204, parallels/ubuntu-14.04, etc. vagrant_box: geerlingguy/ubuntu1404 vagrant_user: vagrant vagrant_synced_folder_default_type: nfs From e7d2fb4bcabc114a9ce376c7efcceb74abdf3f32 Mon Sep 17 00:00:00 2001 From: Jeff Geerling Date: Mon, 2 May 2016 10:13:41 -0500 Subject: [PATCH 0216/1273] Update base OS documentation based on upstream MySQL configuration update. --- docs/other/base-os.md | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/docs/other/base-os.md b/docs/other/base-os.md index d796baaf2..7822c336b 100644 --- a/docs/other/base-os.md +++ b/docs/other/base-os.md @@ -25,23 +25,17 @@ Installed extras that are currently unsupported on Ubuntu 16.04: - `varnish` - `xhprof` -## RedHat Enterprise Linux / CentOS 7 +## Ubuntu 14.04 Trusty LTS -**MySQL/MariaDB**: RHEL/CentOS 7 switched from using MySQL as the default database system to using MariaDB, so to make sure everything is configured properly, you need to add the following to `config.yml` so MariaDB installs correctly: +Everything should work out of the box with Ubuntu 14.04. -```yaml -mysql_packages: - - mariadb - - mariadb-server - - mariadb-libs - - MySQL-python - - perl-DBD-MySQL -mysql_daemon: mariadb -mysql_socket: /var/lib/mysql/mysql.sock -mysql_log_error: /var/log/mariadb/mariadb.log -mysql_syslog_tag: mariadb -mysql_pid_file: /var/run/mariadb/mariadb.pid -``` +## Ubuntu 12.04 Precise LTS + +Everything should work out of the box with Ubuntu 12.04. + +## RedHat Enterprise Linux / CentOS 7 + +Everything should work out of the box with RHEL 7. ## RedHat Enterprise Linux / CentOS 6 From 8543f926e4a3adf70d0bd1a4e399720e0699e978 Mon Sep 17 00:00:00 2001 From: Jeff Geerling Date: Mon, 2 May 2016 10:40:23 -0500 Subject: [PATCH 0217/1273] Update configuration for CentOS 7 tests with MariaDB defaults. --- .travis.yml | 1 - tests/centos-7-vars.yml | 10 ---------- 2 files changed, 11 deletions(-) delete mode 100644 tests/centos-7-vars.yml diff --git a/.travis.yml b/.travis.yml index e42e246f4..f18b1cee8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -22,7 +22,6 @@ env: version: 7 init: /usr/lib/systemd/systemd run_opts: "--privileged --volume=/sys/fs/cgroup:/sys/fs/cgroup:ro" - additional_vars: "centos-7-vars.yml" services: - docker diff --git a/tests/centos-7-vars.yml b/tests/centos-7-vars.yml deleted file mode 100644 index 0b90cd6be..000000000 --- a/tests/centos-7-vars.yml +++ /dev/null @@ -1,10 +0,0 @@ -mysql_packages: - - mariadb - - mariadb-server - - mariadb-libs - - MySQL-python - - perl-DBD-MySQL -mysql_daemon: mariadb -mysql_log_error: /var/log/mariadb/mariadb.log -mysql_syslog_tag: mariadb -mysql_pid_file: /var/run/mariadb/mariadb.pid From 678bb07ca3bdcc52e40179d236944f6d12b2e21a Mon Sep 17 00:00:00 2001 From: Jeff Geerling Date: Mon, 2 May 2016 11:21:49 -0500 Subject: [PATCH 0218/1273] Try to fix broken CentOS setuptools installation. --- tests/Dockerfile.centos-7 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/Dockerfile.centos-7 b/tests/Dockerfile.centos-7 index 3cbb03045..9dda3efa4 100644 --- a/tests/Dockerfile.centos-7 +++ b/tests/Dockerfile.centos-7 @@ -20,6 +20,9 @@ RUN yum clean all RUN easy_install pip RUN pip install ansible +# Fix weird issue with setuptools +RUN pip install --upgrade setuptools --user python + # Disable requiretty RUN sed -i -e 's/^\(Defaults\s*requiretty\)/#--- \1/' /etc/sudoers From 2a2d81833ad5e52f8dbd9cb42aeffbdb36d883dd Mon Sep 17 00:00:00 2001 From: Jeff Geerling Date: Mon, 2 May 2016 11:31:22 -0500 Subject: [PATCH 0219/1273] Install redhat-lsb-core for MySQL role to work correctly on RHEL. --- tests/Dockerfile.centos-7 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/Dockerfile.centos-7 b/tests/Dockerfile.centos-7 index 9dda3efa4..8c9e9d61a 100644 --- a/tests/Dockerfile.centos-7 +++ b/tests/Dockerfile.centos-7 @@ -12,6 +12,8 @@ rm -f /lib/systemd/system/sockets.target.wants/*initctl*; \ rm -f /lib/systemd/system/basic.target.wants/*; \ rm -f /lib/systemd/system/anaconda.target.wants/*; +RUN yum -y install redhat-lsb-core + # Install Ansible RUN yum -y install epel-release RUN yum -y install git sudo which curl tar unzip xz logrotate initscripts From 759353b5d4fb3ee6d3c0d8ae218a18059b1163bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oskar=20Sch=C3=B6ldstr=C3=B6m?= Date: Tue, 3 May 2016 19:22:34 -0500 Subject: [PATCH 0220/1273] Improve multisite docs by matching ProxyPassMatch with documentroot value [ci skip] --- docs/deployment/multisite.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/docs/deployment/multisite.md b/docs/deployment/multisite.md index 92a8d4834..7df856b2f 100644 --- a/docs/deployment/multisite.md +++ b/docs/deployment/multisite.md @@ -5,15 +5,17 @@ apache_vhosts: - servername: "local.my-drupal-site.com" documentroot: "/var/www/my-drupal-site" extra_parameters: | - ProxyPassMatch ^/(.*\.php(/.*)?)$ "fcgi://127.0.0.1:9000{{ drupal_core_path }}" + ProxyPassMatch ^/(.*\.php(/.*)?)$ "fcgi://127.0.0.1:9000/var/www/my-drupal-site" + - servername: "local.second-drupal-site.com" documentroot: "/var/www/my-drupal-site" extra_parameters: | - ProxyPassMatch ^/(.*\.php(/.*)?)$ "fcgi://127.0.0.1:9000{{ drupal_core_path }}" + ProxyPassMatch ^/(.*\.php(/.*)?)$ "fcgi://127.0.0.1:9000/var/www/my-drupal-site" + - servername: "local.third-drupal-site.com" documentroot: "/var/www/my-drupal-site" extra_parameters: | - ProxyPassMatch ^/(.*\.php(/.*)?)$ "fcgi://127.0.0.1:9000{{ drupal_core_path }}" + ProxyPassMatch ^/(.*\.php(/.*)?)$ "fcgi://127.0.0.1:9000/var/www/my-drupal-site" ``` If you need additional databases and database users, add them to the list of `mysql_databases` and `mysql_users`: From 1c927e21400e3ff392adef171135d270d3c11bad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oskar=20Sch=C3=B6ldstr=C3=B6m?= Date: Tue, 3 May 2016 20:18:44 -0500 Subject: [PATCH 0221/1273] Attempt at making basic setup docs more understandable [ci skip] --- docs/deployment/local-codebase.md | 33 +++++++++++++++++++++++++++---- docs/deployment/multisite.md | 19 +++++++++++------- 2 files changed, 41 insertions(+), 11 deletions(-) diff --git a/docs/deployment/local-codebase.md b/docs/deployment/local-codebase.md index 71c8f7d4e..837d53583 100644 --- a/docs/deployment/local-codebase.md +++ b/docs/deployment/local-codebase.md @@ -23,16 +23,41 @@ install_site: false If you aren't copying back a database, and want to have Drupal VM run `drush si` for your Drupal site, you can leave `install_site` set to `true` and it will run a site install on your Drupal codebase using the `drupal_*` config variables. -## Update `apache_vhosts` +## Update `drupal_core_path` -Add your site to `apache_vhosts`, setting the `documentroot` to the same value as the `destination` of the synced folder you configured earlier: +Set `drupal_core_path` to the same value as the `destination` of the synced folder you configured earlier: ```yaml +drupal_core_path: "/var/www/my-drupal-site" +``` + +This variable will be used for the document root of the webserver. + +## Set the domain + +By default the domain of your site will be `drupalvm.dev` but you can change it by setting `drupal_domain` to the domain of your choice: + +``` +drupal_domain: "local.my-drupal-site.com" +``` + +If you prefer using your domain as the root of all extra packages installed, ie. `adminer`, `xhprof` and `pimpmylog`, set it as the value of `vagrant_hostname` instead. + +``` +vagrant_hostname: "my-drupal-site.com" + apache_vhosts: - - servername: "local.my-drupal-site.com" - documentroot: "/var/www/my-drupal-site" + # Resolves to http://my-drupal-site.com/ + - servername: "{{ drupal_domain }}" + documentroot: "{{ drupal_core_path }}" extra_parameters: | ProxyPassMatch ^/(.*\.php(/.*)?)$ "fcgi://127.0.0.1:9000{{ drupal_core_path }}" + + # Resolves to http://adminer.my-drupal-site.com/ + - servername: "adminer.{{ vagrant_hostname }}" + documentroot: "{{ adminer_install_dir }}" + extra_parameters: | + ProxyPassMatch ^/(.*\.php(/.*)?)$ "fcgi://127.0.0.1:9000{{ adminer_install_dir }}" ``` ## Update MySQL info diff --git a/docs/deployment/multisite.md b/docs/deployment/multisite.md index 7df856b2f..0a4471cf8 100644 --- a/docs/deployment/multisite.md +++ b/docs/deployment/multisite.md @@ -1,21 +1,26 @@ For multisite installations, make the changes outlined in the [Local Drupal codebase](local-codebase.md) guide, but, using the `apache_vhosts` variable, configure as many domains pointing to the same docroot as you need: ```yaml +drupal_core_path: "/var/www/my-drupal-site" + +... + apache_vhosts: - - servername: "local.my-drupal-site.com" - documentroot: "/var/www/my-drupal-site" + # Drupal VM's default domain, evaluating to whatever `vagrant_hostname` is set to (drupalvm.dev by default). + - servername: "{{ drupal_domain }}" + documentroot: "{{ drupal_core_path }}" extra_parameters: | - ProxyPassMatch ^/(.*\.php(/.*)?)$ "fcgi://127.0.0.1:9000/var/www/my-drupal-site" + ProxyPassMatch ^/(.*\.php(/.*)?)$ "fcgi://127.0.0.1:9000{{ drupal_core_path }}" - servername: "local.second-drupal-site.com" - documentroot: "/var/www/my-drupal-site" + documentroot: "{{ drupal_core_path }}" extra_parameters: | - ProxyPassMatch ^/(.*\.php(/.*)?)$ "fcgi://127.0.0.1:9000/var/www/my-drupal-site" + ProxyPassMatch ^/(.*\.php(/.*)?)$ "fcgi://127.0.0.1:9000{{ drupal_core_path }}" - servername: "local.third-drupal-site.com" - documentroot: "/var/www/my-drupal-site" + documentroot: "{{ drupal_core_path }}" extra_parameters: | - ProxyPassMatch ^/(.*\.php(/.*)?)$ "fcgi://127.0.0.1:9000/var/www/my-drupal-site" + ProxyPassMatch ^/(.*\.php(/.*)?)$ "fcgi://127.0.0.1:9000{{ drupal_core_path }}" ``` If you need additional databases and database users, add them to the list of `mysql_databases` and `mysql_users`: From 1b4136231f31b453799ca23d719caee7e03b3a70 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oskar=20Sch=C3=B6ldstr=C3=B6m?= Date: Tue, 3 May 2016 20:19:04 -0500 Subject: [PATCH 0222/1273] Docs: Update some examples [ci skip] --- docs/extras/syncing-folders.md | 4 +++- docs/other/local-vagrantfile.md | 3 --- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/docs/extras/syncing-folders.md b/docs/extras/syncing-folders.md index 90a31d40e..dc0f1fe30 100644 --- a/docs/extras/syncing-folders.md +++ b/docs/extras/syncing-folders.md @@ -7,6 +7,7 @@ vagrant_synced_folders: - local_path: ~/Sites/drupalvm destination: /var/www/drupalvm type: smb + create: true ``` You can add as many synced folders as you'd like, and you can configure [any type of share](https://www.vagrantup.com/docs/synced-folders/index.html) supported by Vagrant; just add another item to the list of `vagrant_synced_folders`. @@ -53,9 +54,10 @@ If you are using rsync, it is advised to exclude certain directories so that the ```yaml vagrant_synced_folders: - - local_path: ~/Sites/drupalvm/drupal + - local_path: ~/Sites/drupalvm destination: /var/www/drupalvm type: rsync + create: true excluded_paths: - drupal/private - drupal/public/.git diff --git a/docs/other/local-vagrantfile.md b/docs/other/local-vagrantfile.md index 210558667..80ed5e28c 100644 --- a/docs/other/local-vagrantfile.md +++ b/docs/other/local-vagrantfile.md @@ -11,9 +11,6 @@ config.vm.provider :virtualbox do |v| # Enable GUI mode instead of running a headless machine. v.gui = true - # Reduce disk usage of multiple boxes by sharing a master VM. - v.linked_clone = true - # Cap the host CPU execution at 50% usage. v.customize ["modifyvm", :id, "--cpuexecutioncap", "50"] end From 828dbab6d50785c7da14a8177f5e268c1bac1648 Mon Sep 17 00:00:00 2001 From: Scott Rigby Date: Wed, 4 May 2016 13:13:08 -0400 Subject: [PATCH 0223/1273] New Relic support, conditionally-installed --- example.config.yml | 5 +++++ provisioning/playbook.yml | 1 + 2 files changed, 6 insertions(+) diff --git a/example.config.yml b/example.config.yml index c744738a4..6c4058ae9 100644 --- a/example.config.yml +++ b/example.config.yml @@ -155,6 +155,7 @@ installed_extras: - drupalconsole - mailhog - memcached + # - newrelic # - nodejs - pimpmylog # - redis @@ -168,6 +169,10 @@ installed_extras: # Add any extra apt or yum packages you would like installed. extra_packages: [] +# `newrelic` must be in installed_extras for this to work. +# See all vars: https://github.com/weareinteractive/ansible-newrelic#variables +newrelic_license_key: yourkey + # `nodejs` must be in installed_extras for this to work. Valid examples: "0.10", # "0.12", "4.x", "5.x". nodejs_version: "0.12" diff --git a/provisioning/playbook.yml b/provisioning/playbook.yml index 1b7d3ab99..fe595a915 100644 --- a/provisioning/playbook.yml +++ b/provisioning/playbook.yml @@ -43,6 +43,7 @@ - { role: geerlingguy.pimpmylog, when: '"pimpmylog" in installed_extras' } - { role: geerlingguy.daemonize, when: '"mailhog" in installed_extras' } - { role: geerlingguy.mailhog, when: '"mailhog" in installed_extras' } + - { role: franklinkim.newrelic, when: '"newrelic" in installed_extras' } - { role: geerlingguy.nodejs, when: '"nodejs" in installed_extras' } - { role: geerlingguy.redis, when: '"redis" in installed_extras' } - { role: geerlingguy.php-redis, when: '"redis" in installed_extras' } From 12584985fdf2022c3cf0fae46b1dbf1a0a3013ad Mon Sep 17 00:00:00 2001 From: Jeff Geerling Date: Wed, 4 May 2016 12:54:52 -0500 Subject: [PATCH 0224/1273] Remove installation of redhat-lsb-core. --- tests/Dockerfile.centos-7 | 2 -- 1 file changed, 2 deletions(-) diff --git a/tests/Dockerfile.centos-7 b/tests/Dockerfile.centos-7 index 8c9e9d61a..9dda3efa4 100644 --- a/tests/Dockerfile.centos-7 +++ b/tests/Dockerfile.centos-7 @@ -12,8 +12,6 @@ rm -f /lib/systemd/system/sockets.target.wants/*initctl*; \ rm -f /lib/systemd/system/basic.target.wants/*; \ rm -f /lib/systemd/system/anaconda.target.wants/*; -RUN yum -y install redhat-lsb-core - # Install Ansible RUN yum -y install epel-release RUN yum -y install git sudo which curl tar unzip xz logrotate initscripts From f3a465db8f359166a6ce37a98cf9429b8e34d84c Mon Sep 17 00:00:00 2001 From: Scott Rigby Date: Wed, 4 May 2016 15:07:42 -0400 Subject: [PATCH 0225/1273] Add newrelic to requirements --- provisioning/requirements.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/provisioning/requirements.yml b/provisioning/requirements.yml index 3e6295a95..64d103839 100644 --- a/provisioning/requirements.yml +++ b/provisioning/requirements.yml @@ -1,5 +1,6 @@ --- - src: arknoll.selenium +- src: franklinkim.newrelic - src: geerlingguy.adminer - src: geerlingguy.apache - src: geerlingguy.apache-php-fpm From d72058f9bfb0c01daf691b4943b3da129aff7837 Mon Sep 17 00:00:00 2001 From: Scott Rigby Date: Wed, 4 May 2016 15:25:27 -0400 Subject: [PATCH 0226/1273] Move New Relic documentation to docs/extras --- docs/extras/newrelic.md | 21 +++++++++++++++++++++ example.config.yml | 4 ---- 2 files changed, 21 insertions(+), 4 deletions(-) create mode 100644 docs/extras/newrelic.md diff --git a/docs/extras/newrelic.md b/docs/extras/newrelic.md new file mode 100644 index 000000000..8d8ec1c1c --- /dev/null +++ b/docs/extras/newrelic.md @@ -0,0 +1,21 @@ +The New Relic PHP agent monitors your application to help you identify and solve performance issues. + +## Getting Started - Installing Prerequisites + +To make New Relic available globally for all your projects within Drupal VM, make the following changes inside `config.yml`, then run `vagrant up` (or `vagrant provision` if the VM is already built): + +```yaml +# Make sure newrelic is not commented out in the list of installed_extras: +installed_extras: + [...] + - newrelic + [...] + +# Set vars for your New Relic account: +# `newrelic` must be in installed_extras for this to work. +newrelic_license_key: yourkey +# Customize any additional vars relevant to your project needs. +# See all vars: https://github.com/weareinteractive/ansible-newrelic#variables +``` + +See [New Relic for PHP](https://docs.newrelic.com/docs/agents/php-agent/getting-started/new-relic-php) for help getting started. diff --git a/example.config.yml b/example.config.yml index 6c4058ae9..9d0ad78b4 100644 --- a/example.config.yml +++ b/example.config.yml @@ -169,10 +169,6 @@ installed_extras: # Add any extra apt or yum packages you would like installed. extra_packages: [] -# `newrelic` must be in installed_extras for this to work. -# See all vars: https://github.com/weareinteractive/ansible-newrelic#variables -newrelic_license_key: yourkey - # `nodejs` must be in installed_extras for this to work. Valid examples: "0.10", # "0.12", "4.x", "5.x". nodejs_version: "0.12" From 58495a54727734ca5953836d1eb77d83e0af4d3d Mon Sep 17 00:00:00 2001 From: Jeff Geerling Date: Fri, 6 May 2016 11:22:04 -0500 Subject: [PATCH 0227/1273] Fixes #589: Use Apache 2.4 in Ubuntu 12.04. --- provisioning/tasks/init-debian.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/provisioning/tasks/init-debian.yml b/provisioning/tasks/init-debian.yml index a57a059ac..5f0e680f7 100644 --- a/provisioning/tasks/init-debian.yml +++ b/provisioning/tasks/init-debian.yml @@ -15,6 +15,10 @@ service: name=ufw state=stopped when: ansible_distribution == "Ubuntu" +- name: Add repository for Apache 2.4 on Ubuntu 12. + apt_repository: repo='ppa:ondrej/apache2' + when: ansible_distribution_release == "precise" and ansible_distribution == "Ubuntu" + - name: Add repository for PHP 5.5. apt_repository: repo='ppa:ondrej/php5' when: php_version == "5.5" and ansible_distribution == "Ubuntu" From 4120f76d65a4f1737472e611fc7b5bb64a0b9fcb Mon Sep 17 00:00:00 2001 From: Jeff Geerling Date: Sat, 7 May 2016 21:08:00 -0500 Subject: [PATCH 0228/1273] Fixes #597: Add a note about vagrant ssh. --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index e327559ae..f69e8a913 100644 --- a/README.md +++ b/README.md @@ -120,6 +120,7 @@ Drupal VM runs on almost any modern computer that can run VirtualBox and Vagrant ## Other Notes - To shut down the virtual machine, enter `vagrant halt` in the Terminal in the same folder that has the `Vagrantfile`. To destroy it completely (if you want to save a little disk space, or want to rebuild it from scratch with `vagrant up` again), type in `vagrant destroy`. + - To log into the virtual machine, enter `vagrant ssh`. You can also get the machine's SSH connection details with `vagrant ssh-config`. - When you rebuild the VM (e.g. `vagrant destroy` and then another `vagrant up`), make sure you clear out the contents of the `drupal` folder on your host machine, or Drupal will return some errors when the VM is rebuilt (it won't reinstall Drupal cleanly). - You can change the installed version of Drupal or drush, or any other configuration options, by editing the variables within `config.yml`. - Find out more about local development with Vagrant + VirtualBox + Ansible in this presentation: [Local Development Environments - Vagrant, VirtualBox and Ansible](http://www.slideshare.net/geerlingguy/local-development-on-virtual-machines-vagrant-virtualbox-and-ansible). From 3d1f71928f3dae6053e52ba8bd191e7b3b3000e3 Mon Sep 17 00:00:00 2001 From: Jeff Geerling Date: Tue, 10 May 2016 07:58:53 -0500 Subject: [PATCH 0229/1273] Fixes #598: Add support for pre_provision_scripts. --- example.config.yml | 5 +++-- provisioning/playbook.yml | 5 +++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/example.config.yml b/example.config.yml index 9d0ad78b4..8f4073559 100644 --- a/example.config.yml +++ b/example.config.yml @@ -226,8 +226,9 @@ composer_home_group: "{{ drupalvm_user }}" # composer_global_packages: # - { name: phpunit/phpunit, release: '@stable' } -# Run specified scripts after VM is provisioned. Path is relative to the -# `provisioning/playbook.yml` file. +# Run specified scripts before or after VM is provisioned. Path is relative to +# the `provisioning/playbook.yml` file. +pre_provision_scripts: [] post_provision_scripts: [] # - "../examples/scripts/configure-solr.sh" diff --git a/provisioning/playbook.yml b/provisioning/playbook.yml index fe595a915..b0c34c7f2 100644 --- a/provisioning/playbook.yml +++ b/provisioning/playbook.yml @@ -12,6 +12,11 @@ - include: tasks/init-redhat.yml when: ansible_os_family == 'RedHat' + - name: Run configured pre-provision shell scripts. + script: "{{ item }}" + with_items: "{{ pre_provision_scripts }}" + when: pre_provision_scripts is defined + - name: Set the PHP webserver daemon correctly when nginx is in use. set_fact: php_webserver_daemon: nginx From 72c6f0957223f08c7534e2d8e9b288ec97ac632e Mon Sep 17 00:00:00 2001 From: Jeff Geerling Date: Tue, 10 May 2016 08:06:23 -0500 Subject: [PATCH 0230/1273] PR #513: Fix style and content in Windows NFSD documentation. --- docs/other/windows.md | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/docs/other/windows.md b/docs/other/windows.md index 42373784e..25d1cb851 100644 --- a/docs/other/windows.md +++ b/docs/other/windows.md @@ -44,27 +44,20 @@ You can use the [vagrant-winnfsd](https://github.com/GM-Alex/vagrant-winnfsd) pl Another option for the more adventurous is to manually install and configure WinNFSD, and manually mount the shares within your VM. This requires a bit more work, but could be more stable on Windows; see this blog post for more details: [Windows + Vagrant + WinNFSD without file update problems](https://hollyit.net/blog/windowsvagrantwinnfsd-without-file-update-problems). -GuyPaddock's fork of [vagrant-winnfsd](https://github.com/GuyPaddock/vagrant-winnfsd) adds logging and debug messages. You can replace the vagrant-winnfsd gem inside .vagrant.d\gems\gems to use it instead. - -The best config is to mount only one folder with nfs see [vagrant-winnfsd issue #12](https://github.com/winnfsd/vagrant-winnfsd/issues/12#issuecomment-78195957), so you need to adapt your config and set vagrant folder to native: +GuyPaddock's [fork of `vagrant-winnfsd`](https://github.com/GuyPaddock/vagrant-winnfsd) adds logging and debug messages. You can replace the vagrant-winnfsd gem inside `.vagrant.d\gems\gems` to use it instead. For further caveats, please read through [vagrant-winnfsd issue #12](https://github.com/winnfsd/vagrant-winnfsd/issues/12#issuecomment-78195957), and make the following changes to `config.yml`: vagrant_synced_folder_default_type: "" -Add mount_options to your synced folder to avoid an error: +Add `mount_options` to your synced folder to avoid an error: type: nfs mount_options: ["rw","vers=3","udp","nolock"] -In your Vagrantfile.local, add user access to vagrant: +In a custom `Vagrantfile.local`, add user access to Vagrant: config.winnfsd.uid=900 config.winnfsd.gid=900 -If you are using the fork of vagrant-winnfsd, you can set aditionnal options and use logging="on" in case of problem in your Vagrantfile.local: - - config.winnfsd.logging="off" - config.winnfsd.halt_on_reload="on" - ### "Authentication failure" on vagrant up Some Windows users have reported running into an issue where an authentication failure is reported once the VM is booted (e.g. `drupalvm: Warning: Authentication failure. Retrying...` — see [#170](https://github.com/geerlingguy/drupal-vm/issues/170)). To fix this, do the following: From 9749414255ba42782bca4d38165cccd2c4d99e08 Mon Sep 17 00:00:00 2001 From: Jeff Geerling Date: Tue, 10 May 2016 08:16:03 -0500 Subject: [PATCH 0231/1273] Fixes #594: Update JJG-Ansible-Windows to 1.3.0. --- provisioning/JJG-Ansible-Windows/windows.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/provisioning/JJG-Ansible-Windows/windows.sh b/provisioning/JJG-Ansible-Windows/windows.sh index 728b63cd5..bab2355b0 100644 --- a/provisioning/JJG-Ansible-Windows/windows.sh +++ b/provisioning/JJG-Ansible-Windows/windows.sh @@ -72,7 +72,7 @@ fi # Install requirements. echo "Installing Ansible roles from requirements file, if available." -find "/vagrant/$PLAYBOOK_DIR" \( -name "requirements.yml" -o -name "requirements.txt" \) -exec sudo ansible-galaxy install --ignore-errors -r {} \; +find "/vagrant/$PLAYBOOK_DIR" \( -name "requirements.yml" -o -name "requirements.txt" \) -exec sudo ansible-galaxy install --force --ignore-errors -r {} \; # Run the playbook. echo "Running Ansible provisioner defined in Vagrantfile." From 4e0b4a0e486daed65050847ba337f355ee002717 Mon Sep 17 00:00:00 2001 From: Jeff Geerling Date: Tue, 10 May 2016 08:27:43 -0500 Subject: [PATCH 0232/1273] Fixes #536: Document Drupal VM upgrade process. --- README.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/README.md b/README.md index f69e8a913..e7e33be9e 100644 --- a/README.md +++ b/README.md @@ -109,6 +109,17 @@ If you don't want or need one or more of these extras, just delete them or comme Drupal VM is built to integrate with every developer's workflow. Many guides for using Drupal VM for common development tasks are available on the [Drupal VM documentation site](http://docs.drupalvm.com). +## Updating Drupal VM + +Drupal VM follows semantic versioning, which means your configuration should continue working (potentially with very minor modifications) throughout a major release cycle. Here is the process to follow when updating Drupal VM between minor releases: + + 1. Read through the [release notes](https://github.com/geerlingguy/drupal-vm/releases) and add/modify `config.yml` variables mentioned therein. + 2. Do a diff of my config.yml with the updated example.config.yml (e.g. `curl https://raw.githubusercontent.com/geerlingguy/drupal-vm/master/example.config.yml | git diff --no-index config.yml -`). + 3. If Ansible is installed, update all roles locally (`sudo ansible-galaxy install -r provisioning/requirements.yml --force`). + 4. Run `vagrant provision` to provision the VM, incorporating all the latest changes. + +For major version upgrades (e.g. 2.x.x to 3.x.x), it may be simpler to destroy the VM (`vagrant destroy`) then build a fresh new VM (`vagrant up`) using the new version of Drupal VM. + ## System Requirements Drupal VM runs on almost any modern computer that can run VirtualBox and Vagrant, however for the best out-of-the-box experience, it's recommended you have a computer with at least: From 4534ca8a250e7278cf0035ff2de33dfbc267c87c Mon Sep 17 00:00:00 2001 From: Jeff Geerling Date: Tue, 10 May 2016 08:48:15 -0500 Subject: [PATCH 0233/1273] Fixes #505: Add ansible.cfg file to set a roles_path in Drupal VM directory. --- ansible.cfg | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 ansible.cfg diff --git a/ansible.cfg b/ansible.cfg new file mode 100644 index 000000000..002a50dd5 --- /dev/null +++ b/ansible.cfg @@ -0,0 +1,2 @@ +[defaults] +roles_path = ./roles From 0ec0790ca50fbf9414fc441f626acc2ea4326d43 Mon Sep 17 00:00:00 2001 From: Jeff Geerling Date: Tue, 10 May 2016 08:54:04 -0500 Subject: [PATCH 0234/1273] Issue #505: Remove sudo from ansible-galaxy command documentation. --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index e7e33be9e..f3ce080db 100644 --- a/README.md +++ b/README.md @@ -72,7 +72,7 @@ Notes: - Copy `example.config.yml` to `config.yml`. 3. Create a local directory where Drupal will be installed and configure the path to that directory in `config.yml` (`local_path`, inside `vagrant_synced_folders`). 4. Open Terminal, `cd` to this directory (containing the `Vagrantfile` and this README file). - 5. (If you have Ansible installed on Mac/Linux) Run `$ sudo ansible-galaxy install -r provisioning/requirements.yml --force`. + 5. (If you have Ansible installed on Mac/Linux) Run `$ ansible-galaxy install -r provisioning/requirements.yml --force`. 6. Type in `vagrant up`, and let Vagrant do its magic. Note: *If there are any errors during the course of running `vagrant up`, and it drops you back to your command prompt, just run `vagrant provision` to continue building the VM from where you left off. If there are still errors after doing this a few times, post an issue to this project's issue queue on GitHub with the error.* @@ -115,7 +115,7 @@ Drupal VM follows semantic versioning, which means your configuration should con 1. Read through the [release notes](https://github.com/geerlingguy/drupal-vm/releases) and add/modify `config.yml` variables mentioned therein. 2. Do a diff of my config.yml with the updated example.config.yml (e.g. `curl https://raw.githubusercontent.com/geerlingguy/drupal-vm/master/example.config.yml | git diff --no-index config.yml -`). - 3. If Ansible is installed, update all roles locally (`sudo ansible-galaxy install -r provisioning/requirements.yml --force`). + 3. If Ansible is installed, update all roles locally (`ansible-galaxy install -r provisioning/requirements.yml --force`). 4. Run `vagrant provision` to provision the VM, incorporating all the latest changes. For major version upgrades (e.g. 2.x.x to 3.x.x), it may be simpler to destroy the VM (`vagrant destroy`) then build a fresh new VM (`vagrant up`) using the new version of Drupal VM. From 3ce2be1aea995a473f9cb799bee7338774595ca4 Mon Sep 17 00:00:00 2001 From: Jeff Geerling Date: Tue, 10 May 2016 17:59:18 -0500 Subject: [PATCH 0235/1273] Fixes #526: Add Blackfire.io support to Drupal VM. --- docs/extras/profile-code.md | 50 +++++++++++++++++++++++++++++++++++ docs/extras/xhprof.md | 18 ------------- example.config.yml | 1 + mkdocs.yml | 2 +- provisioning/playbook.yml | 1 + provisioning/requirements.yml | 1 + 6 files changed, 54 insertions(+), 19 deletions(-) create mode 100644 docs/extras/profile-code.md delete mode 100644 docs/extras/xhprof.md diff --git a/docs/extras/profile-code.md b/docs/extras/profile-code.md new file mode 100644 index 000000000..28d6a0c54 --- /dev/null +++ b/docs/extras/profile-code.md @@ -0,0 +1,50 @@ +You can profile your code using one of the supported profiling tools included in Drupal VM. + +As a prerequisite, you need to make sure the profiler you'd like to use is listed (and not commented out) in `installed_extras` inside `config.yml` (So the appropriate software is installed on Drupal VM). + +**Note**: You should only enable one code profiler at a time—e.g. when using Blackfire, disable XHProf and XDebug. + +## Blackfire + +[Blackfire.io](https://blackfire.io/) is a service that allows code profiling to be stored and analyzed via an online profile on the Blackfire.io website. + +It doesn't require any additional Drupal modules to use, but once you've made sure `blackfire` is in the list of `installed_extras` in `config.yml` (and Drupal VM has been provisioned), you need to log into Drupal VM and [run the setup steps outlined on the Blackfire Ansible role's README](https://github.com/geerlingguy/ansible-role-blackfire#requirements). + +Once you've configured your environment for your own Blackfire account, you can profile a request with Blackfire by running something like the following example (within Drupal VM, after logging in with `vagrant ssh`): + +``` +$ blackfire curl http://drupalvm.dev/ +Profiling: [########################################] 10/10 +Blackfire cURL completed +Graph URL https://blackfire.io/profiles/[UUID]/graph + +Wall Time 151ms +CPU Time 130ms +I/O Time 20.9ms +Memory 1.5MB +Network n/a n/a - +SQL n/a - +``` + +## XHProf + +[XHProf](http://xhprof.io/) allows easy code profiling and can be used in many different ways. Ensure `xhprof` is in the list of `installed_extras` inside `config.yml`. + +### XHProf module + +The easiest way to use XHProf to profile your PHP code on a Drupal site is to install the [XHProf](https://www.drupal.org/project/xhprof) module, then in XHProf's configuration (at `/admin/config/development/xhprof`), check the 'Enable profiling of page views and drush requests' checkbox. + +The XHProf module doesn't include built-in support for callgraphs, but there's an issue to [add callgraph support](https://www.drupal.org/node/1470740). + +You can view callgraphs (and a listing of all stored runs) using Drupal VM's own XHProf installation by visiting `http://xhprof.drupalvm.dev/` and clicking on the relevant run, then clicking the "[View Full Callgraph]" link. + +### Devel module (deprecated) + +The Devel module also *used* to provide XHProf configuration, and setting the options below would allow Devel's XHProf integration to work correctly with Drupal VM's XHProf installation: + + - **xhprof directory**: `/usr/share/php` + - **XHProf URL**: `http://xhprof.drupalvm.dev` (assuming this domain is configured in `apache_vhosts` inside `config.yml`) + +## XDebug + +[XDebug](https://xdebug.org/) is a debugger and profiler for PHP. While most people use it only for debugging purposes, you can also use it for profiling. It's not as commonly used for profiling as either Blackfire or XHProf, but it works! diff --git a/docs/extras/xhprof.md b/docs/extras/xhprof.md deleted file mode 100644 index 972a49201..000000000 --- a/docs/extras/xhprof.md +++ /dev/null @@ -1,18 +0,0 @@ -As a prerequisite, make sure you have `xhprof` in the `installed_extras` list inside `config.yml` (So the PHP XHProf extension is installed on Drupal VM). - -**Note**: You should disable `xdebug` when enabling/using XHProf, because it is known to have issues running alongside XHProf, and makes test results less reliable and slower than they should be. - -## XHProf module - -The easiest way to use XHProf to profile your PHP code on a Drupal site is to install the [XHProf](https://www.drupal.org/project/xhprof) module, then in XHProf's configuration (at `/admin/config/development/xhprof`), check the 'Enable profiling of page views and drush requests' checkbox. - -The XHProf module doesn't include built-in support for callgraphs, but there's an issue to [add callgraph support](https://www.drupal.org/node/1470740). - -You can view callgraphs (and a listing of all stored runs) using Drupal VM's own XHProf installation by visiting `http://xhprof.drupalvm.dev/` and clicking on the relevant run, then clicking the "[View Full Callgraph]" link. - -## Devel module (deprecated) - -The Devel module also *used* to provide XHProf configuration, and setting the options below would allow Devel's XHProf integration to work correctly with Drupal VM's XHProf installation: - - - **xhprof directory**: `/usr/share/php` - - **XHProf URL**: `http://xhprof.drupalvm.dev` (assuming this domain is configured in `apache_vhosts` inside `config.yml`) diff --git a/example.config.yml b/example.config.yml index 9d0ad78b4..24f6413c6 100644 --- a/example.config.yml +++ b/example.config.yml @@ -152,6 +152,7 @@ mysql_users: # to install *any* extras, make set this value to an empty set, e.g. `[]`. installed_extras: - adminer + # - blackfire - drupalconsole - mailhog - memcached diff --git a/mkdocs.yml b/mkdocs.yml index 797d5d2e6..6e12f4fe9 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -25,7 +25,7 @@ pages: - 'Use Node.js and NPM': 'extras/nodejs.md' - 'Use SSL vhosts with Apache': 'extras/ssl.md' - 'View Logs with Pimp my Log': 'extras/pimpmylog.md' - - 'Profile Code with XHProf': 'extras/xhprof.md' + - 'Profile Code - XHProf, Blackfire, Xdebug': 'extras/profile-code.md' - 'Debug Code with XDebug': 'extras/xdebug.md' - 'Catch Emails with MailHog': 'extras/mailhog.md' - 'Test with Behat and Selenium': 'extras/behat.md' diff --git a/provisioning/playbook.yml b/provisioning/playbook.yml index fe595a915..4679c48bb 100644 --- a/provisioning/playbook.yml +++ b/provisioning/playbook.yml @@ -39,6 +39,7 @@ - { role: geerlingguy.php-memcached, when: '"memcached" in installed_extras' } - { role: geerlingguy.php-xdebug, when: '"xdebug" in installed_extras' } - { role: geerlingguy.php-xhprof, when: '"xhprof" in installed_extras' } + - { role: geerlingguy.blackfire, when: '"blackfire" in installed_extras' } - { role: geerlingguy.adminer, when: '"adminer" in installed_extras' } - { role: geerlingguy.pimpmylog, when: '"pimpmylog" in installed_extras' } - { role: geerlingguy.daemonize, when: '"mailhog" in installed_extras' } diff --git a/provisioning/requirements.yml b/provisioning/requirements.yml index 64d103839..cdde642e7 100644 --- a/provisioning/requirements.yml +++ b/provisioning/requirements.yml @@ -4,6 +4,7 @@ - src: geerlingguy.adminer - src: geerlingguy.apache - src: geerlingguy.apache-php-fpm +- src: geerlingguy.blackfire - src: geerlingguy.composer - src: geerlingguy.daemonize - src: geerlingguy.drupal-console From 0156a796b2ada0843ee3590a9c0b907c925670aa Mon Sep 17 00:00:00 2001 From: Jeff Geerling Date: Tue, 10 May 2016 23:08:00 -0500 Subject: [PATCH 0236/1273] Fixes #523: Fix documentation for adding drupal-extension and dependencies. --- docs/extras/behat.md | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/docs/extras/behat.md b/docs/extras/behat.md index 32de03a38..40a39018d 100644 --- a/docs/extras/behat.md +++ b/docs/extras/behat.md @@ -13,9 +13,6 @@ installed_extras: # Make sure the following four packages are in composer_global_packages: composer_global_packages: - - { name: behat/mink, release: '1.5.*@stable' } - - { name: behat/mink-goutte-driver, release: '*' } - - { name: behat/mink-selenium2-driver, release: '*' } - { name: drupal/drupal-extension, release: '*' } ``` @@ -26,7 +23,7 @@ $ behat --version behat version 3.0.15 ``` -_You can also include the `behat/*` and `drupal/drupal-extension` directly in your project's `composer.json` file, and install the dependencies per-project. Either option (installing globally, like above, or installing per-project) is perfectly acceptable._ +_You can also include `drupal/drupal-extension` directly in your project's `composer.json` file, and install the dependencies per-project. Either option (installing globally, like above, or installing per-project) is perfectly acceptable._ ## Setting up Behat for your project From f4364f3d0d71ed8d7298ee5a2cd8a887f418e31d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oskar=20Sch=C3=B6ldstr=C3=B6m?= Date: Wed, 11 May 2016 15:08:21 -0500 Subject: [PATCH 0237/1273] Fix misleading error message when attempting to install drupal without a codebase --- provisioning/tasks/install-site.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/provisioning/tasks/install-site.yml b/provisioning/tasks/install-site.yml index 9ddf99254..a5f1c1bc1 100644 --- a/provisioning/tasks/install-site.yml +++ b/provisioning/tasks/install-site.yml @@ -4,7 +4,7 @@ {{ drush_path }} status bootstrap chdir={{ drupal_core_path }} register: drupal_site_installed - failed_when: false + failed_when: "drupal_site_installed.stdout is undefined" changed_when: false become: no From a04c0d0e8ef993832e4627bdf581f24efcade352 Mon Sep 17 00:00:00 2001 From: Jeff Geerling Date: Wed, 11 May 2016 22:05:44 -0500 Subject: [PATCH 0238/1273] Fixes #608: Lock Ansible role versions to a specific release. --- provisioning/requirements.yml | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/provisioning/requirements.yml b/provisioning/requirements.yml index cdde642e7..6ee82d0af 100644 --- a/provisioning/requirements.yml +++ b/provisioning/requirements.yml @@ -1,34 +1,67 @@ --- - src: arknoll.selenium + version: 1.2.0 - src: franklinkim.newrelic + version: 1.2.0 - src: geerlingguy.adminer + version: 1.1.0 - src: geerlingguy.apache + version: 1.7.2 - src: geerlingguy.apache-php-fpm + version: 1.0.2 - src: geerlingguy.blackfire + version: 1.0.0 - src: geerlingguy.composer + version: 1.4.0 - src: geerlingguy.daemonize + version: 1.1.0 - src: geerlingguy.drupal-console + version: 1.0.7 - src: geerlingguy.drush + version: 1.1.2 - src: geerlingguy.firewall + version: 1.0.9 - src: geerlingguy.git + version: 1.1.1 - src: geerlingguy.java + version: 1.4.0 - src: geerlingguy.mailhog + version: 1.1.0 - src: geerlingguy.memcached + version: 1.0.4 - src: geerlingguy.mysql + version: 2.2.1 - src: geerlingguy.nginx + version: 1.9.2 - src: geerlingguy.nodejs + version: 3.0.0 - src: geerlingguy.php + version: 2.0.3 - src: geerlingguy.php-memcached + version: 1.1.0 - src: geerlingguy.php-mysql + version: 1.2.0 - src: geerlingguy.php-pecl + version: 1.2.1 - src: geerlingguy.php-redis + version: 2.0.0 - src: geerlingguy.php-xdebug + version: 2.1.0 - src: geerlingguy.php-xhprof + version: 2.1.0 - src: geerlingguy.pimpmylog + version: 1.0.2 - src: geerlingguy.postfix + version: 1.1.0 - src: geerlingguy.redis + version: 1.2.0 - src: geerlingguy.repo-remi + version: 1.2.0 - src: geerlingguy.ruby + version: 2.3.1 - src: geerlingguy.security + version: 1.2.0 - src: geerlingguy.solr + version: 2.1.0 - src: geerlingguy.varnish + version: 1.5.0 From 36f0eaee50ececd8c359795c8cb551626c78fd66 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oskar=20Sch=C3=B6ldstr=C3=B6m?= Date: Sat, 9 Apr 2016 18:27:00 -0500 Subject: [PATCH 0239/1273] Issue #455: Add support for local.config.yml and prod.config.yml --- Vagrantfile | 9 +++++++-- provisioning/playbook.yml | 5 +++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/Vagrantfile b/Vagrantfile index e68861320..691ef00d8 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -24,13 +24,18 @@ def walk(obj, &fn) end end -# Use config.yml for basic VM configuration. +# Use config.yml, prod.config.yml and local.config.yml for VM configuration. require 'yaml' +vconfig = {} dir = File.dirname(File.expand_path(__FILE__)) unless File.exist?("#{dir}/config.yml") raise 'Configuration file not found! Please copy example.config.yml to config.yml and try again.' end -vconfig = YAML.load_file("#{dir}/config.yml") +['config.yml', 'prod.config.yml', 'local.config.yml'].each do |file| + if File.exist?("#{dir}/#{file}") + vconfig.merge!(YAML.load_file("#{dir}/#{file}")) + end +end # Replace jinja variables in config. vconfig = walk(vconfig) do |value| diff --git a/provisioning/playbook.yml b/provisioning/playbook.yml index 97cf21ff1..0d4dec07e 100644 --- a/provisioning/playbook.yml +++ b/provisioning/playbook.yml @@ -7,6 +7,11 @@ - ../config.yml pre_tasks: + - include_vars: "{{ item }}" + with_fileglob: + - ../../prod.config.yml + - ../../local.config.yml + - include: tasks/init-debian.yml when: ansible_os_family == 'Debian' - include: tasks/init-redhat.yml From e5a4fc4711dbaf3ca309530d65c99f6258230d15 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oskar=20Sch=C3=B6ldstr=C3=B6m?= Date: Thu, 12 May 2016 14:05:14 -0500 Subject: [PATCH 0240/1273] Cleanup code to distinguish optional config files from the required config.yml --- Vagrantfile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Vagrantfile b/Vagrantfile index 691ef00d8..57cb580fe 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -26,12 +26,13 @@ end # Use config.yml, prod.config.yml and local.config.yml for VM configuration. require 'yaml' -vconfig = {} dir = File.dirname(File.expand_path(__FILE__)) unless File.exist?("#{dir}/config.yml") raise 'Configuration file not found! Please copy example.config.yml to config.yml and try again.' end -['config.yml', 'prod.config.yml', 'local.config.yml'].each do |file| +vconfig = YAML.load_file("#{dir}/config.yml") +# Include environment config files if available. +['prod.config.yml', 'local.config.yml'].each do |file| if File.exist?("#{dir}/#{file}") vconfig.merge!(YAML.load_file("#{dir}/#{file}")) end From 92dd354ab93192d5c8125e3ca17768fc4fe61f3e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oskar=20Sch=C3=B6ldstr=C3=B6m?= Date: Thu, 12 May 2016 15:08:00 -0500 Subject: [PATCH 0241/1273] Remove support for prod.config.yml for now --- Vagrantfile | 10 ++++------ provisioning/playbook.yml | 1 - 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/Vagrantfile b/Vagrantfile index 57cb580fe..5e0ff5c45 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -24,18 +24,16 @@ def walk(obj, &fn) end end -# Use config.yml, prod.config.yml and local.config.yml for VM configuration. +# Use config.yml and local.config.yml for VM configuration. require 'yaml' dir = File.dirname(File.expand_path(__FILE__)) unless File.exist?("#{dir}/config.yml") raise 'Configuration file not found! Please copy example.config.yml to config.yml and try again.' end vconfig = YAML.load_file("#{dir}/config.yml") -# Include environment config files if available. -['prod.config.yml', 'local.config.yml'].each do |file| - if File.exist?("#{dir}/#{file}") - vconfig.merge!(YAML.load_file("#{dir}/#{file}")) - end +# Include a local.config.yml file if available. +if File.exist?("#{dir}/local.config.yml") + vconfig.merge!(YAML.load_file("#{dir}/local.config.yml")) end # Replace jinja variables in config. diff --git a/provisioning/playbook.yml b/provisioning/playbook.yml index 0d4dec07e..aa4ebbd63 100644 --- a/provisioning/playbook.yml +++ b/provisioning/playbook.yml @@ -9,7 +9,6 @@ pre_tasks: - include_vars: "{{ item }}" with_fileglob: - - ../../prod.config.yml - ../../local.config.yml - include: tasks/init-debian.yml From a7a308677d50369187c76a33aad4d6dd1ec6a010 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oskar=20Sch=C3=B6ldstr=C3=B6m?= Date: Thu, 12 May 2016 15:10:16 -0500 Subject: [PATCH 0242/1273] Add documentation about local.config.yml [ci skip] --- ...ntfile.md => overriding-configurations.md} | 23 ++++++++++++++++++- mkdocs.yml | 2 +- 2 files changed, 23 insertions(+), 2 deletions(-) rename docs/other/{local-vagrantfile.md => overriding-configurations.md} (67%) diff --git a/docs/other/local-vagrantfile.md b/docs/other/overriding-configurations.md similarity index 67% rename from docs/other/local-vagrantfile.md rename to docs/other/overriding-configurations.md index 80ed5e28c..dbf982e0c 100644 --- a/docs/other/local-vagrantfile.md +++ b/docs/other/overriding-configurations.md @@ -1,3 +1,24 @@ +## Overriding variables in `config.yml` with a `local.config.yml` + +If available, Drupal VM will also load a `local.config.yml` after having loaded the main `config.yml`. Using this file you can override variables previously defined in `config.yml`. For teams who are sharing a VM configuration, this is a good place to configure anything that's specific to your own environment. + +```yaml +# Increase the memory available to your Drupal site. +vagrant_memory: 1536 +php_memory_limit: "512M" + +# Override the synced folders to use rsync instead of NFS. +vagrant_synced_folders: + - local_path: ~/Sites/drupalvm + destination: /var/www/drupalvm + type: rsync + create: true +``` + +_Note: The merge of the variables in these two files is shallow, so if you want to override a single item in a list, you will need to re-define all items in that list._ + +## Extending the `Vagrantfile` with `Vagrantfile.local` + Out of the box Drupal VM supports having VirtualBox, Parallels as well as VMware as a provider. Besides these there are multitude of others available (for example `vagrant-aws`, `vagrant-digitalocean`). If you want to use an unsupported provider, or otherwise modify the vagrant configuration in a way that is not exposed by Drupal VM, you can create a `Vagrantfile.local` in the root directory of this project. @@ -16,7 +37,7 @@ config.vm.provider :virtualbox do |v| end ``` -## Example: Using the `vagrant-aws` provider +### Example: Using the `vagrant-aws` provider Add the following variables to your `config.yml`. diff --git a/mkdocs.yml b/mkdocs.yml index 6e12f4fe9..2bf8e10fb 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -33,7 +33,7 @@ pages: - Other Information: - 'Using Different Base OSes': 'other/base-os.md' - 'Using Different Webservers': 'other/webservers.md' - - 'Using a local Vagrantfile': 'other/local-vagrantfile.md' + - 'Overriding configurations': 'other/overriding-configurations.md' - 'PHP 7 on Drupal VM': 'other/php-7.md' - 'BigPipe with Drupal VM': 'other/bigpipe.md' - 'Drupal VM Management Tools': 'other/management-tools.md' From 2d94c77235636d14bb9fcb451f153976a679cf32 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oskar=20Sch=C3=B6ldstr=C3=B6m?= Date: Thu, 12 May 2016 15:37:44 -0500 Subject: [PATCH 0243/1273] Issue #614: Install cron jobs as the SSH user instead of as root --- example.config.yml | 4 ++-- provisioning/tasks/cron.yml | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/example.config.yml b/example.config.yml index 9bebf5871..448f80ed6 100644 --- a/example.config.yml +++ b/example.config.yml @@ -60,8 +60,8 @@ drupal_mysql_database: drupal # Additional arguments or options to pass to `drush site-install`. drupal_site_install_extra_args: [] -# Cron jobs are added to the root user's crontab. Keys include name (required), -# minute, hour, day, weekday, month, job (required), and state. +# Cron jobs are added to the vagrant user's crontab. Keys include name +# (required), minute, hour, day, weekday, month, job (required), and state. drupalvm_cron_jobs: [] # - { # name: "Drupal Cron", diff --git a/provisioning/tasks/cron.yml b/provisioning/tasks/cron.yml index 5d3725650..96f726425 100644 --- a/provisioning/tasks/cron.yml +++ b/provisioning/tasks/cron.yml @@ -1,5 +1,5 @@ --- -- name: Ensure configured cron jobs exist in root account's crontab. +- name: Ensure configured cron jobs exist in user account's crontab. cron: name: "{{ item.name }}" minute: "{{ item.minute | default('*') }}" @@ -11,3 +11,4 @@ state: "{{ item.state | default('present') }}" with_items: "{{ drupalvm_cron_jobs }}" when: drupalvm_cron_jobs is defined + become: no From afff8c5875178e056a139f321253134e6c229ca9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oskar=20Sch=C3=B6ldstr=C3=B6m?= Date: Wed, 11 May 2016 22:20:11 -0500 Subject: [PATCH 0244/1273] Followup #608: Automate ansible-galaxy install step --- README.md | 6 ++---- Vagrantfile | 1 + docs/other/overriding-configurations.md | 3 +++ docs/other/php-7.md | 2 -- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index f3ce080db..b90a5aa28 100644 --- a/README.md +++ b/README.md @@ -72,8 +72,7 @@ Notes: - Copy `example.config.yml` to `config.yml`. 3. Create a local directory where Drupal will be installed and configure the path to that directory in `config.yml` (`local_path`, inside `vagrant_synced_folders`). 4. Open Terminal, `cd` to this directory (containing the `Vagrantfile` and this README file). - 5. (If you have Ansible installed on Mac/Linux) Run `$ ansible-galaxy install -r provisioning/requirements.yml --force`. - 6. Type in `vagrant up`, and let Vagrant do its magic. + 5. Type in `vagrant up`, and let Vagrant do its magic. Note: *If there are any errors during the course of running `vagrant up`, and it drops you back to your command prompt, just run `vagrant provision` to continue building the VM from where you left off. If there are still errors after doing this a few times, post an issue to this project's issue queue on GitHub with the error.* @@ -115,8 +114,7 @@ Drupal VM follows semantic versioning, which means your configuration should con 1. Read through the [release notes](https://github.com/geerlingguy/drupal-vm/releases) and add/modify `config.yml` variables mentioned therein. 2. Do a diff of my config.yml with the updated example.config.yml (e.g. `curl https://raw.githubusercontent.com/geerlingguy/drupal-vm/master/example.config.yml | git diff --no-index config.yml -`). - 3. If Ansible is installed, update all roles locally (`ansible-galaxy install -r provisioning/requirements.yml --force`). - 4. Run `vagrant provision` to provision the VM, incorporating all the latest changes. + 3. Run `vagrant provision` to provision the VM, incorporating all the latest changes. For major version upgrades (e.g. 2.x.x to 3.x.x), it may be simpler to destroy the VM (`vagrant destroy`) then build a fresh new VM (`vagrant up`) using the new version of Drupal VM. diff --git a/Vagrantfile b/Vagrantfile index 5e0ff5c45..ffac05663 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -113,6 +113,7 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| if which('ansible-playbook') config.vm.provision 'ansible' do |ansible| ansible.playbook = "#{dir}/provisioning/playbook.yml" + ansible.galaxy_role_file = "#{dir}/provisioning/requirements.yml" end else config.vm.provision 'shell' do |sh| diff --git a/docs/other/overriding-configurations.md b/docs/other/overriding-configurations.md index dbf982e0c..118a65008 100644 --- a/docs/other/overriding-configurations.md +++ b/docs/other/overriding-configurations.md @@ -35,6 +35,9 @@ config.vm.provider :virtualbox do |v| # Cap the host CPU execution at 50% usage. v.customize ["modifyvm", :id, "--cpuexecutioncap", "50"] end + +# Disable the galaxy role re-installation during provisions. +config.vm.provisioners[0].config.galaxy_role_file = nil ``` ### Example: Using the `vagrant-aws` provider diff --git a/docs/other/php-7.md b/docs/other/php-7.md index 5a185895f..dbab3a23c 100644 --- a/docs/other/php-7.md +++ b/docs/other/php-7.md @@ -1,7 +1,5 @@ Drupal VM fully supports PHP 7, but currently defaults to 5.6 in order to maximize compatibility with older Drupal 6 and 7 sites. Soon, Drupal VM will change its defaults to install PHP 7.x instead of 5.x, but until then, follow the instructions below to use PHP 7. -_Note: If you have Ansible installed on your host machine, make sure you're running the latest version of all Ansible role dependencies by running `ansible-galaxy install -r provisioning/requirements.yml --force` inside the root Drupal VM project folder._ - ## Ubuntu 14.04 Ondřej Surý's PPA for PHP 7.0 is included with Drupal VM, and you can make the following changes/additions to `config.yml` to use it: From 157b0edc1e247ffa30b375846069364c30cb1e02 Mon Sep 17 00:00:00 2001 From: Jeff Geerling Date: Thu, 12 May 2016 07:55:47 -0500 Subject: [PATCH 0245/1273] Issue #609: Switch all defaults to Ubuntu 16.04 and PHP 7. --- README.md | 7 +++--- docs/other/php-56.md | 44 ++++++++++++++++++++++++++++++++++ docs/other/php-7.md | 45 ----------------------------------- example.config.yml | 17 +++++++------ mkdocs.yml | 2 +- provisioning/requirements.yml | 4 ++-- 6 files changed, 59 insertions(+), 60 deletions(-) create mode 100644 docs/other/php-56.md delete mode 100644 docs/other/php-7.md diff --git a/README.md b/README.md index b90a5aa28..109fe4043 100644 --- a/README.md +++ b/README.md @@ -9,10 +9,10 @@ This project aims to make spinning up a simple local Drupal test/development env It will install the following on an Ubuntu 14.04 (by default) linux VM: - Apache 2.4.x (or Nginx 1.x) - - PHP 5.6.x (configurable) - - MySQL 5.5.x + - PHP 7.0.x (configurable) + - MySQL 5.7.x - Drush (configurable) - - Drupal 6.x, 7.x, or 8.x.x (configurable) + - Drupal 7.x, or 8.x.x (configurable) - Optional: - Drupal Console - Varnish 4.x (configurable) @@ -23,6 +23,7 @@ It will install the following on an Ubuntu 14.04 (by default) linux VM: - Memcached - Redis - XHProf, for profiling your code + - Blackfire, for profiling your code - XDebug, for debugging your code - Adminer, for accessing databases directly - Pimp my Log, for easy viewing of log files diff --git a/docs/other/php-56.md b/docs/other/php-56.md new file mode 100644 index 000000000..c91374a99 --- /dev/null +++ b/docs/other/php-56.md @@ -0,0 +1,44 @@ +Drupal VM defaults to PHP 7, but you can install and use 5.6 if you need to maximize compatibility with older Drupal 6 and 7 sites. + +_Note: If you have Ansible installed on your host machine, make sure you're running the latest version of all Ansible role dependencies by running `ansible-galaxy install -r provisioning/requirements.yml --force` inside the root Drupal VM project folder._ + +## Ubuntu 16.04 + +Ubuntu 16.04 Xenial defaults to PHP 7.0 in it's system packages. No older versions of PHP will be supported if using this base box. + +## Ubuntu 14.04 + +Ondřej Surý's PPA for PHP 7.0 is used to install PHP 7, but you can switch to using different 5.6 packages instead by making the following changes to `config.yml`: + +```yaml +php_version: "5.6" +php_packages: + - php5 + - php5-mcrypt + - php5-cli + - php5-common + - php5-curl + - php5-dev + - php5-fpm + - php5-gd + - php-pear + - libpcre3-dev +php_conf_paths: + - /etc/php5/fpm + - /etc/php5/apache2 + - /etc/php5/cli +php_extension_conf_paths: + - /etc/php5/fpm/conf.d + - /etc/php5/apache2/conf.d + - /etc/php5/cli/conf.d +php_fpm_daemon: php5-fpm +php_fpm_conf_path: "/etc/php5/fpm" +php_mysql_package: php5-mysql +``` + +## RedHat/CentOS 7 + +Remi's RPM repository is included with Drupal VM, and you can make the following changes to use it to install PHP 5.6 instead of 7: + + 1. Make sure you've followed the directions for switching to CentOS 7 in the [use a different base OS](base-os.md) guide. + 2. Change `php_version` inside `config.yml` to `"5.6"`. diff --git a/docs/other/php-7.md b/docs/other/php-7.md deleted file mode 100644 index dbab3a23c..000000000 --- a/docs/other/php-7.md +++ /dev/null @@ -1,45 +0,0 @@ -Drupal VM fully supports PHP 7, but currently defaults to 5.6 in order to maximize compatibility with older Drupal 6 and 7 sites. Soon, Drupal VM will change its defaults to install PHP 7.x instead of 5.x, but until then, follow the instructions below to use PHP 7. - -## Ubuntu 14.04 - -Ondřej Surý's PPA for PHP 7.0 is included with Drupal VM, and you can make the following changes/additions to `config.yml` to use it: - -```yaml -php_version: "7.0" -php_packages: - - php7.0-common - - php7.0-cli - - php7.0-dev - - php7.0-fpm - - libpcre3-dev - - php7.0-gd - - php7.0-curl - - php7.0-imap - - php7.0-json - - php7.0-opcache - - php7.0-xml - - php7.0-mbstring -php_mysql_package: php7.0-mysql -php_fpm_daemon: php7.0-fpm -php_conf_paths: - - /etc/php/7.0/fpm - - /etc/php/7.0/apache2 - - /etc/php/7.0/cli -php_extension_conf_paths: - - /etc/php/7.0/fpm/conf.d - - /etc/php/7.0/apache2/conf.d - - /etc/php/7.0/cli/conf.d -php_fpm_pool_conf_path: "/etc/php/7.0/fpm/pool.d/www.conf" -``` - -Also, comment out `xhprof`, `redis` and `memcached` from the `installed_extras` list, as these extensions are not yet supported for PHP 7 (as of late 2015). - -You can also build from source using the same/included `geerlingguy.php` Ansible role, but that process is a bit more involved and for power users comfortable with the process. - -## RedHat/CentOS 7 - -Remi's RPM repository is included with Drupal VM, and you can make the following changes to use it to install PHP 7: - - 1. Make sure you've followed the directions for switching to CentOS 7 in the [use a different base OS](base-os.md) guide. - 2. Change `php_version` inside `config.yml` to `"7.0"`. - 3. Comment out `xhprof`, `xdebug`, `redis` and `memcached` from the `installed_extras` list, as these extensions are not yet supported for PHP 7 (as of early 2016). diff --git a/example.config.yml b/example.config.yml index 448f80ed6..066c006cc 100644 --- a/example.config.yml +++ b/example.config.yml @@ -1,7 +1,7 @@ --- # `vagrant_box` can also be set to geerlingguy/centos6, geerlingguy/centos7, -# geerlingguy/ubuntu1604, geerlingguy/ubuntu1204, parallels/ubuntu-14.04, etc. -vagrant_box: geerlingguy/ubuntu1404 +# geerlingguy/ubuntu1404, geerlingguy/ubuntu1204, parallels/ubuntu-14.04, etc. +vagrant_box: geerlingguy/ubuntu1604 vagrant_user: vagrant vagrant_synced_folder_default_type: nfs @@ -155,7 +155,7 @@ installed_extras: # - blackfire - drupalconsole - mailhog - - memcached + # - memcached # - newrelic # - nodejs - pimpmylog @@ -164,8 +164,8 @@ installed_extras: # - selenium # - solr - varnish - - xdebug - - xhprof + # - xdebug + # - xhprof # Add any extra apt or yum packages you would like installed. extra_packages: [] @@ -200,10 +200,9 @@ firewall_allowed_tcp_ports: - "8983" firewall_log_dropped_packets: false -# PHP Configuration. Currently-supported versions: 5.5, 5.6, 7.0. -# PHP 7.0 requires a few additional changes. See the documentation at -# http://docs.drupalvm.com/en/latest/other/php-7/ -php_version: "5.6" +# PHP Configuration. Currently-supported versions: 5.6, 7.0. +# To use 5.6, see: http://docs.drupalvm.com/en/latest/other/php-56/ +php_version: "7.0" php_memory_limit: "192M" php_display_errors: "On" php_display_startup_errors: "On" diff --git a/mkdocs.yml b/mkdocs.yml index 2bf8e10fb..4ec6a3334 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -34,7 +34,7 @@ pages: - 'Using Different Base OSes': 'other/base-os.md' - 'Using Different Webservers': 'other/webservers.md' - 'Overriding configurations': 'other/overriding-configurations.md' - - 'PHP 7 on Drupal VM': 'other/php-7.md' + - 'PHP 5.6 on Drupal VM': 'other/php-56.md' - 'BigPipe with Drupal VM': 'other/bigpipe.md' - 'Drupal VM Management Tools': 'other/management-tools.md' - 'Networking Notes': 'other/networking.md' diff --git a/provisioning/requirements.yml b/provisioning/requirements.yml index 6ee82d0af..db3b0a260 100644 --- a/provisioning/requirements.yml +++ b/provisioning/requirements.yml @@ -36,11 +36,11 @@ - src: geerlingguy.nodejs version: 3.0.0 - src: geerlingguy.php - version: 2.0.3 + version: 3.0.0 - src: geerlingguy.php-memcached version: 1.1.0 - src: geerlingguy.php-mysql - version: 1.2.0 + version: 2.0.0 - src: geerlingguy.php-pecl version: 1.2.1 - src: geerlingguy.php-redis From 6309cb9b6764a93b77dcdcfccec7889b7b853316 Mon Sep 17 00:00:00 2001 From: Jeff Geerling Date: Thu, 12 May 2016 08:00:30 -0500 Subject: [PATCH 0246/1273] Issue #609: Clean up some references to / usage of PHP < 7. --- examples/acquia/README.md | 2 +- provisioning/tasks/init-debian.yml | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/acquia/README.md b/examples/acquia/README.md index cbb1ebd41..74f546dd8 100644 --- a/examples/acquia/README.md +++ b/examples/acquia/README.md @@ -4,7 +4,7 @@ This directory contains example configuration changes for the default Drupal VM - Ubuntu 12.04.5 LTS - Apache 2.2.22 - - PHP 5.5.23 + - PHP 5.6.21 - MySQL/Percona 5.5.24 - Apache Solr 4.5.1 diff --git a/provisioning/tasks/init-debian.yml b/provisioning/tasks/init-debian.yml index 5f0e680f7..10e774ad1 100644 --- a/provisioning/tasks/init-debian.yml +++ b/provisioning/tasks/init-debian.yml @@ -21,15 +21,15 @@ - name: Add repository for PHP 5.5. apt_repository: repo='ppa:ondrej/php5' - when: php_version == "5.5" and ansible_distribution == "Ubuntu" + when: php_version == "5.5" and ansible_distribution == "Ubuntu" and ansible_distribution_version == "12.04" - name: Add repository for PHP 5.6. apt_repository: repo='ppa:ondrej/php5-5.6' - when: php_version == "5.6" and ansible_distribution == "Ubuntu" + when: php_version == "5.6" and ansible_distribution == "Ubuntu" and ansible_distribution_version != "16.04" - name: Add repository for PHP 7.0. apt_repository: repo='ppa:ondrej/php' - when: php_version == "7.0" and ansible_distribution == "Ubuntu" + when: php_version == "7.0" and ansible_distribution == "Ubuntu" and ansible_distribution_version != "16.04" - name: Define php_xhprof_html_dir. set_fact: From 0de0926ff7acc1a99443bca54adc3e27d5143053 Mon Sep 17 00:00:00 2001 From: Jeff Geerling Date: Thu, 12 May 2016 09:33:36 -0500 Subject: [PATCH 0247/1273] Bump requirements for php-redis and php-memcached roles. --- provisioning/requirements.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/provisioning/requirements.yml b/provisioning/requirements.yml index db3b0a260..bc4278f63 100644 --- a/provisioning/requirements.yml +++ b/provisioning/requirements.yml @@ -38,13 +38,13 @@ - src: geerlingguy.php version: 3.0.0 - src: geerlingguy.php-memcached - version: 1.1.0 + version: 2.0.0 - src: geerlingguy.php-mysql version: 2.0.0 - src: geerlingguy.php-pecl version: 1.2.1 - src: geerlingguy.php-redis - version: 2.0.0 + version: 3.0.0 - src: geerlingguy.php-xdebug version: 2.1.0 - src: geerlingguy.php-xhprof From f1b55957275ebe3571b2332128a5d784d95992c8 Mon Sep 17 00:00:00 2001 From: Jeff Geerling Date: Thu, 12 May 2016 15:05:46 -0500 Subject: [PATCH 0248/1273] Bump version requirement for php-xhprof role. --- provisioning/requirements.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/provisioning/requirements.yml b/provisioning/requirements.yml index bc4278f63..cd2a18768 100644 --- a/provisioning/requirements.yml +++ b/provisioning/requirements.yml @@ -48,7 +48,7 @@ - src: geerlingguy.php-xdebug version: 2.1.0 - src: geerlingguy.php-xhprof - version: 2.1.0 + version: 2.1.1 - src: geerlingguy.pimpmylog version: 1.0.2 - src: geerlingguy.postfix From d765963f690e2a3765202e9fc1b2b8618ceee7fd Mon Sep 17 00:00:00 2001 From: Jeff Geerling Date: Fri, 13 May 2016 07:47:09 -0500 Subject: [PATCH 0249/1273] Fixes #609: Fix a couple things that were breaking. --- example.config.yml | 3 +++ provisioning/requirements.yml | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/example.config.yml b/example.config.yml index 066c006cc..12ee43c50 100644 --- a/example.config.yml +++ b/example.config.yml @@ -259,6 +259,9 @@ php_xdebug_remote_connect_back: 1 php_xdebug_idekey: PHPSTORM php_xdebug_max_nesting_level: 256 +# XHProf configuration. +xhprof_output_dir: /var/tmp + # Solr Configuration (if enabled above). solr_version: "4.10.4" solr_xms: "64M" diff --git a/provisioning/requirements.yml b/provisioning/requirements.yml index cd2a18768..f17ed03ab 100644 --- a/provisioning/requirements.yml +++ b/provisioning/requirements.yml @@ -36,7 +36,7 @@ - src: geerlingguy.nodejs version: 3.0.0 - src: geerlingguy.php - version: 3.0.0 + version: 3.0.1 - src: geerlingguy.php-memcached version: 2.0.0 - src: geerlingguy.php-mysql @@ -48,7 +48,7 @@ - src: geerlingguy.php-xdebug version: 2.1.0 - src: geerlingguy.php-xhprof - version: 2.1.1 + version: 2.1.2 - src: geerlingguy.pimpmylog version: 1.0.2 - src: geerlingguy.postfix From 61f5802d1fa1943adcf513c0119f23ef5efe498b Mon Sep 17 00:00:00 2001 From: Jeff Geerling Date: Fri, 13 May 2016 08:46:27 -0500 Subject: [PATCH 0250/1273] Remove unneeded xhprof var. --- example.config.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/example.config.yml b/example.config.yml index 12ee43c50..066c006cc 100644 --- a/example.config.yml +++ b/example.config.yml @@ -259,9 +259,6 @@ php_xdebug_remote_connect_back: 1 php_xdebug_idekey: PHPSTORM php_xdebug_max_nesting_level: 256 -# XHProf configuration. -xhprof_output_dir: /var/tmp - # Solr Configuration (if enabled above). solr_version: "4.10.4" solr_xms: "64M" From 8289d2a2afd394bb9be9088fbf457202c8b899ff Mon Sep 17 00:00:00 2001 From: Jeff Geerling Date: Fri, 13 May 2016 10:26:04 -0500 Subject: [PATCH 0251/1273] Update Base OS documentation. --- docs/other/base-os.md | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/docs/other/base-os.md b/docs/other/base-os.md index 7822c336b..89dc935cc 100644 --- a/docs/other/base-os.md +++ b/docs/other/base-os.md @@ -2,8 +2,8 @@ Drupal VM's configuration is designed to work with RedHat and Debian-compatible Currently-supported OSes are: - - Ubuntu 16.04 - - Ubuntu 14.04 (default) + - Ubuntu 16.04 (default) + - Ubuntu 14.04 - Ubuntu 12.04 - RedHat Enterprise Linux / CentOS 7 - RedHat Enterprise Linux / CentOS 6 @@ -14,16 +14,7 @@ Some other OSes should work, but are not regularly tested with Drupal VM, includ ## Ubuntu 16.04 Xenial LTS -Ubuntu 16.04 is the latest LTS release, and there are a few changes currently required to make sure Drupal VM runs smoothly on it. Note also that Ubuntu 16.04 defaults to PHP 7; older versions of PHP will not be supported on this OS. - -**Redis**: If using redis, add the line `php_redis_package: php-redis` to `config.yml` before provisioning. - -Installed extras that are currently unsupported on Ubuntu 16.04: - - - `memcached` - - `selenium` - - `varnish` - - `xhprof` +Everything should work out of the box with Ubuntu 16.04. ## Ubuntu 14.04 Trusty LTS From 490749de70722a3bf48861d8fd2714abe6667464 Mon Sep 17 00:00:00 2001 From: Jeff Geerling Date: Fri, 13 May 2016 10:27:07 -0500 Subject: [PATCH 0252/1273] Bump PHP role version to 3.0.2. --- provisioning/requirements.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/provisioning/requirements.yml b/provisioning/requirements.yml index f17ed03ab..5bb78e58b 100644 --- a/provisioning/requirements.yml +++ b/provisioning/requirements.yml @@ -36,7 +36,7 @@ - src: geerlingguy.nodejs version: 3.0.0 - src: geerlingguy.php - version: 3.0.1 + version: 3.0.2 - src: geerlingguy.php-memcached version: 2.0.0 - src: geerlingguy.php-mysql From ad6ee6fd488e7bcef9f4c4404a41bd0bac11b20a Mon Sep 17 00:00:00 2001 From: Jeff Geerling Date: Fri, 13 May 2016 10:49:20 -0500 Subject: [PATCH 0253/1273] Remove XHProf integration test temporarily. --- .travis.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index f18b1cee8..31a0e0ff6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -85,11 +85,11 @@ script: && (echo 'Pimp my Log install pass' && exit 0) || (echo 'Pimp my Log install fail' && exit 1) - - > - sudo docker exec "$(cat ${container_id})" curl -s --header Host:xhprof.${HOSTNAME} localhost - | grep -q 'XHProf' - && (echo 'XHProf install pass' && exit 0) - || (echo 'XHProf install fail' && exit 1) + # - > + # sudo docker exec "$(cat ${container_id})" curl -s --header Host:xhprof.${HOSTNAME} localhost + # | grep -q '<title>XHProf' + # && (echo 'XHProf install pass' && exit 0) + # || (echo 'XHProf install fail' && exit 1) - > sudo docker exec "$(cat ${container_id})" curl -s localhost:8025 From 077ddbc85a9dc1101b8cc0a036e7b20222ebfb48 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oskar=20Sch=C3=B6ldstr=C3=B6m?= <public@oxy.fi> Date: Sat, 14 May 2016 07:37:13 -0500 Subject: [PATCH 0254/1273] Issue #616: Switch travis tests from Ubuntu 14.04 to 16.04 --- .travis.yml | 6 +++--- tests/{Dockerfile.ubuntu-14.04 => Dockerfile.ubuntu-16.04} | 2 +- tests/{ubuntu-14-nginx.yml => ubuntu-16-nginx.yml} | 0 3 files changed, 4 insertions(+), 4 deletions(-) rename tests/{Dockerfile.ubuntu-14.04 => Dockerfile.ubuntu-16.04} (95%) rename tests/{ubuntu-14-nginx.yml => ubuntu-16-nginx.yml} (100%) diff --git a/.travis.yml b/.travis.yml index 31a0e0ff6..25b0ca25f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,14 +10,14 @@ env: IP: 192.168.88.88 matrix: - distribution: ubuntu - version: 14.04 + version: 16.04 init: /sbin/init run_opts: "--privileged" - distribution: ubuntu - version: 14.04 + version: 16.04 init: /sbin/init run_opts: "--privileged" - additional_vars: ubuntu-14-nginx.yml + additional_vars: ubuntu-16-nginx.yml - distribution: centos version: 7 init: /usr/lib/systemd/systemd diff --git a/tests/Dockerfile.ubuntu-14.04 b/tests/Dockerfile.ubuntu-16.04 similarity index 95% rename from tests/Dockerfile.ubuntu-14.04 rename to tests/Dockerfile.ubuntu-16.04 index 266f96287..443cc58b2 100644 --- a/tests/Dockerfile.ubuntu-14.04 +++ b/tests/Dockerfile.ubuntu-16.04 @@ -1,4 +1,4 @@ -FROM ubuntu:14.04 +FROM ubuntu:16.04 RUN apt-get update # Install Ansible diff --git a/tests/ubuntu-14-nginx.yml b/tests/ubuntu-16-nginx.yml similarity index 100% rename from tests/ubuntu-14-nginx.yml rename to tests/ubuntu-16-nginx.yml From 42148c327cd0725b4e9a0d5bb666aa34b0d732e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oskar=20Sch=C3=B6ldstr=C3=B6m?= <public@oxy.fi> Date: Sat, 14 May 2016 07:48:58 -0500 Subject: [PATCH 0255/1273] Use local.config.yml in travis tests --- .travis.yml | 7 +++---- tests/{test-vars.yml => local.config.yml} | 1 + tests/ubuntu-16-nginx.config.yml | 3 +++ tests/ubuntu-16-nginx.yml | 1 - 4 files changed, 7 insertions(+), 5 deletions(-) rename tests/{test-vars.yml => local.config.yml} (92%) create mode 100644 tests/ubuntu-16-nginx.config.yml delete mode 100644 tests/ubuntu-16-nginx.yml diff --git a/.travis.yml b/.travis.yml index 25b0ca25f..cfc1ae5d3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -17,7 +17,7 @@ env: version: 16.04 init: /sbin/init run_opts: "--privileged" - additional_vars: ubuntu-16-nginx.yml + local_config: ubuntu-16-nginx.config.yml - distribution: centos version: 7 init: /usr/lib/systemd/systemd @@ -53,9 +53,8 @@ script: - 'sudo docker exec "$(cat ${container_id})" cp /var/www/drupalvm/$CONFIG /var/www/drupalvm/config.yml' - 'sudo docker exec "$(cat ${container_id})" cp /var/www/drupalvm/$MAKEFILE /var/www/drupalvm/drupal.make.yml' - # Append additional variables. - - 'sudo docker exec "$(cat ${container_id})" bash -c "cat /var/www/drupalvm/tests/test-vars.yml >> /var/www/drupalvm/config.yml" || true' - - '[[ $additional_vars ]] && sudo docker exec "$(cat ${container_id})" bash -c "cat /var/www/drupalvm/tests/${additional_vars} >> /var/www/drupalvm/config.yml" || true' + # Override configuration variables. + - 'sudo docker exec "$(cat ${container_id})" bash -c "cp /var/www/drupalvm/tests/${local_config:-local.config.yml} /var/www/drupalvm/local.config.yml" || true' # Vagrantfile syntax check - 'rubocop --except LineLength,Eval,MutableConstant' diff --git a/tests/test-vars.yml b/tests/local.config.yml similarity index 92% rename from tests/test-vars.yml rename to tests/local.config.yml index 3c765fddb..3344edd2f 100644 --- a/tests/test-vars.yml +++ b/tests/local.config.yml @@ -1 +1,2 @@ +--- composer_home_path: "/{{ drupalvm_user }}/.composer" diff --git a/tests/ubuntu-16-nginx.config.yml b/tests/ubuntu-16-nginx.config.yml new file mode 100644 index 000000000..35deff7cc --- /dev/null +++ b/tests/ubuntu-16-nginx.config.yml @@ -0,0 +1,3 @@ +--- +composer_home_path: "/{{ drupalvm_user }}/.composer" +drupalvm_webserver: nginx diff --git a/tests/ubuntu-16-nginx.yml b/tests/ubuntu-16-nginx.yml deleted file mode 100644 index 848ddb468..000000000 --- a/tests/ubuntu-16-nginx.yml +++ /dev/null @@ -1 +0,0 @@ -drupalvm_webserver: nginx From eaa0c43ba2da869b0dbf81a7d8b7137e9c92d1e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oskar=20Sch=C3=B6ldstr=C3=B6m?= <public@oxy.fi> Date: Sat, 14 May 2016 07:56:25 -0500 Subject: [PATCH 0256/1273] Issue #616: Bring README up to date [ci skip] --- README.md | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 109fe4043..134340329 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ This project aims to make spinning up a simple local Drupal test/development environment incredibly quick and easy, and to introduce new developers to the wonderful world of Drupal development on local virtual machines (instead of crufty old MAMP/WAMP-based development). -It will install the following on an Ubuntu 14.04 (by default) linux VM: +It will install the following on an Ubuntu 16.04 (by default) linux VM: - Apache 2.4.x (or Nginx 1.x) - PHP 7.0.x (configurable) @@ -44,7 +44,7 @@ There are a couple places where you can customize the VM for your needs: - `config.yml`: Contains variables like the VM domain name and IP address, PHP and MySQL configuration, etc. - `drupal.make.yml`: Contains configuration for the Drupal core version, modules, and patches that will be downloaded on Drupal's initial installation (more about [Drush make files](https://www.drupal.org/node/1432374)). -If you want to switch from Drupal 8 (default) to Drupal 7 or 6 on the initial install, do the following: +If you want to switch from Drupal 8 (default) to Drupal 7 on the initial install, do the following: 1. Update the Drupal `version` and `core` inside the `drupal.make.yml` file. 2. Update `drupal_major_version` inside `config.yml`. @@ -90,9 +90,11 @@ By default, this VM includes the extras listed in the `config.yml` option `insta installed_extras: - adminer + # - blackfire - drupalconsole - mailhog - - memcached + # - memcached + # - newrelic # - nodejs - pimpmylog # - redis @@ -100,8 +102,8 @@ By default, this VM includes the extras listed in the `config.yml` option `insta # - selenium # - solr - varnish - - xdebug - - xhprof + # - xdebug + # - xhprof If you don't want or need one or more of these extras, just delete them or comment them from the list. This is helpful if you want to reduce PHP memory usage or otherwise conserve system resources. From 0583bea6669106b99f4084e184a7b570bbc4b500 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oskar=20Sch=C3=B6ldstr=C3=B6m?= <public@oxy.fi> Date: Sat, 14 May 2016 08:12:33 -0500 Subject: [PATCH 0257/1273] Use stock ansible in travis ubuntu 16 for now --- tests/Dockerfile.ubuntu-16.04 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/Dockerfile.ubuntu-16.04 b/tests/Dockerfile.ubuntu-16.04 index 443cc58b2..9313987fb 100644 --- a/tests/Dockerfile.ubuntu-16.04 +++ b/tests/Dockerfile.ubuntu-16.04 @@ -3,7 +3,9 @@ RUN apt-get update # Install Ansible RUN apt-get install -y software-properties-common git -RUN apt-add-repository -y ppa:ansible/ansible +# The ansible repository does not provide deb packages for Xenial yet +# https://github.com/ansible/ansible/issues/15524 +# RUN apt-add-repository -y ppa:ansible/ansible RUN apt-get update RUN apt-get install -y ansible ufw curl From 8f7ea72a0137e538ee0340e3d0b836eee3a54ace Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oskar=20Sch=C3=B6ldstr=C3=B6m?= <public@oxy.fi> Date: Sat, 14 May 2016 08:09:03 -0500 Subject: [PATCH 0258/1273] Issue #616: Update docs [ci skip] --- docs/extras/mariadb.md | 2 +- docs/extras/scripts.md | 10 +++++++--- docs/extras/varnish.md | 4 ++-- docs/other/bigpipe.md | 2 +- example.config.yml | 2 +- mkdocs.yml | 2 +- 6 files changed, 13 insertions(+), 9 deletions(-) diff --git a/docs/extras/mariadb.md b/docs/extras/mariadb.md index 4989bf833..44ab0a268 100644 --- a/docs/extras/mariadb.md +++ b/docs/extras/mariadb.md @@ -9,7 +9,7 @@ mysql_packages: - python-mysqldb ``` -This set of packages works out of the box with the default Ubuntu 14.04 installation that comes with Drupal VM. +This set of packages works out of the box with Ubuntu 14.04 as well as the default Ubuntu 16.04 installation that comes with Drupal VM. Alternatively, if you want to use RedHat 7 or CentOS 7 instead of Ubuntu, you can set the following variables to install and configure MariaDB instead of MySQL: diff --git a/docs/extras/scripts.md b/docs/extras/scripts.md index 2ae9b6f29..cb45c1a13 100644 --- a/docs/extras/scripts.md +++ b/docs/extras/scripts.md @@ -1,14 +1,18 @@ -Drupal VM allows you to run extra shell scripts at the end of the provisioning process, in case you need to do extra setup, further configure the VM, or install extra software outside the purview of Drupal VM. +Drupal VM allows you to run extra shell scripts in the beginning and at the end of the provisioning process, in case you need to do extra setup, further configure the VM, or install extra software outside the purview of Drupal VM. To use an extra script, configure the path to the script (relative to `provisioning/playbook.yml`) in `config.yml`: ```yaml +pre_provision_scripts: + - "../scripts/pre-provision.sh" post_provision_scripts: - "../scripts/post-provision.sh" ``` -The above example results in a `post-provision.sh` script running after the main Drupal VM setup is complete. Post provision scripts run after the first `vagrant up`, and then any time you run Vagrant provisioning (e.g. `vagrant provision` or `vagrant up --provision`). +The above example results in a `pre-provision.sh` script running before the provisioning starts and a `post-provision.sh` script running after the main Drupal VM setup is complete. Pre and post provision scripts run after the first `vagrant up`, and then any time you run Vagrant provisioning (e.g. `vagrant provision` or `vagrant up --provision`). + +_Note: The pre provision scripts run before any other packages are installed. If you want to use commands such as `git`, you need to install the packages yourself._ You can define as many scripts as you would like, and any arguments after the path will be passed to the shell script itself (e.g. `"- "../scripts/setup-paths.sh --option"`). -Place your post-provision scripts inside a `scripts` directory in the root of your Drupal VM project directory; this directory is gitignored, so you can continue to update Drupal VM without overwriting your scripts. +Place your pre and post provision scripts inside a `scripts` directory in the root of your Drupal VM project directory; this directory is gitignored, so you can continue to update Drupal VM without overwriting your scripts. diff --git a/docs/extras/varnish.md b/docs/extras/varnish.md index 95e1be858..a1b416c71 100644 --- a/docs/extras/varnish.md +++ b/docs/extras/varnish.md @@ -25,8 +25,8 @@ In order for Varnish to actually do anything helpful (instead of just pass throu You will also need to make a few small changes to your site's `settings.php` configuration to make Drupal work correctly behind a reverse proxy like Varnish: ```php -$conf['reverse_proxy'] = TRUE; -$conf['reverse_proxy_addresses'] = array('127.0.0.1'); +$settings['reverse_proxy'] = TRUE; +$settings['reverse_proxy_addresses'] = array('127.0.0.1'); ``` If you don't set these values, Drupal will think all requests are coming from `127.0.0.1`. There are other settings you can change to make Drupal not store copies of cached pages in the Database (since Varnish is caching everything, this is redundant), but those other settings are not covered here. \ No newline at end of file diff --git a/docs/other/bigpipe.md b/docs/other/bigpipe.md index 82315dfd5..08af8704e 100644 --- a/docs/other/bigpipe.md +++ b/docs/other/bigpipe.md @@ -31,7 +31,7 @@ This will disable the `mod_deflate` module for any requests inside that director If you want to switch Apache to use `mod_php` instead of proxying requests through PHP-FPM, you can make the following changes in `config.yml`: - 1. Add `libapache2-mod-php5` to `extra_packages` in `config.yml`. + 1. Add `libapache2-mod-php7.0` to `extra_packages` in `config.yml`. 2. Delete the `extra_parameters` under any Drupal site in the list of `apache_vhosts` (so there is no `ProxyPassMatch` rule). You can also disable PHP-FPM and remove the two `proxy` entries from `apache_mods_enabled` if you don't want to use PHP-FPM with Apache at all, but that's optional; it won't break anything to run Apache with `mod_php` and `mod_proxy_fastcgi` at the same time. diff --git a/example.config.yml b/example.config.yml index 066c006cc..7d4dcb602 100644 --- a/example.config.yml +++ b/example.config.yml @@ -215,7 +215,7 @@ php_max_input_vars: "4000" # Drupal VM defaults to using PHP-FPM with either Apache or Nginx. If you wish # to instead use Apache + mod_php with an Ubuntu base box, make sure you add -# libapache2-mod-php5 to `extra_packages` elsewhere in this config file. +# libapache2-mod-php7.0 to `extra_packages` elsewhere in this config file. php_enable_php_fpm: true php_fpm_listen: "127.0.0.1:9000" diff --git a/mkdocs.yml b/mkdocs.yml index 4ec6a3334..0bea536fb 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -29,7 +29,7 @@ pages: - 'Debug Code with XDebug': 'extras/xdebug.md' - 'Catch Emails with MailHog': 'extras/mailhog.md' - 'Test with Behat and Selenium': 'extras/behat.md' - - 'Add Post-Provision Scripts': 'extras/scripts.md' + - 'Add Pre- and Post-Provision Scripts': 'extras/scripts.md' - Other Information: - 'Using Different Base OSes': 'other/base-os.md' - 'Using Different Webservers': 'other/webservers.md' From 0ca7909328b0d949fe0e604620fd48fd5247e1c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oskar=20Sch=C3=B6ldstr=C3=B6m?= <public@oxy.fi> Date: Sat, 14 May 2016 08:36:12 -0500 Subject: [PATCH 0259/1273] Ensure sudo is available on Ubuntu --- provisioning/tasks/init-debian.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/provisioning/tasks/init-debian.yml b/provisioning/tasks/init-debian.yml index 10e774ad1..b6bc20aa7 100644 --- a/provisioning/tasks/init-debian.yml +++ b/provisioning/tasks/init-debian.yml @@ -9,6 +9,7 @@ - python-apt - python-pycurl - build-essential + - sudo - unzip - name: Disable the ufw firewall (since we use a simple iptables firewall). From af9573da8c289936417880c9d9f460dcc6f27286 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oskar=20Sch=C3=B6ldstr=C3=B6m?= <public@oxy.fi> Date: Sat, 14 May 2016 09:00:50 -0500 Subject: [PATCH 0260/1273] Disable AppArmor in docker containers --- tests/Dockerfile.ubuntu-16.04 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/Dockerfile.ubuntu-16.04 b/tests/Dockerfile.ubuntu-16.04 index 9313987fb..b8f68786b 100644 --- a/tests/Dockerfile.ubuntu-16.04 +++ b/tests/Dockerfile.ubuntu-16.04 @@ -12,5 +12,8 @@ RUN apt-get install -y ansible ufw curl COPY initctl_faker . RUN chmod +x initctl_faker && rm -fr /sbin/initctl && ln -s /initctl_faker /sbin/initctl +# Disable AppArmor as it doesn't work properly within Docker containers. +RUN apt-get remove apparmor + # Install Ansible inventory file RUN echo "[local]\nlocalhost ansible_connection=local" > /etc/ansible/hosts From fd48808d9b13acb98b31e0eba679912dc8cbb4e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oskar=20Sch=C3=B6ldstr=C3=B6m?= <public@oxy.fi> Date: Sat, 14 May 2016 09:30:35 -0500 Subject: [PATCH 0261/1273] Install apparmor on docker containers --- tests/Dockerfile.ubuntu-16.04 | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/tests/Dockerfile.ubuntu-16.04 b/tests/Dockerfile.ubuntu-16.04 index b8f68786b..bd524d0da 100644 --- a/tests/Dockerfile.ubuntu-16.04 +++ b/tests/Dockerfile.ubuntu-16.04 @@ -7,13 +7,10 @@ RUN apt-get install -y software-properties-common git # https://github.com/ansible/ansible/issues/15524 # RUN apt-add-repository -y ppa:ansible/ansible RUN apt-get update -RUN apt-get install -y ansible ufw curl +RUN apt-get install -y ansible ufw curl apparmor apparmor-profiles COPY initctl_faker . RUN chmod +x initctl_faker && rm -fr /sbin/initctl && ln -s /initctl_faker /sbin/initctl -# Disable AppArmor as it doesn't work properly within Docker containers. -RUN apt-get remove apparmor - # Install Ansible inventory file RUN echo "[local]\nlocalhost ansible_connection=local" > /etc/ansible/hosts From 99d01b26ec26a5fd46e80f0db7f238a9bd854cd3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oskar=20Sch=C3=B6ldstr=C3=B6m?= <public@oxy.fi> Date: Sat, 14 May 2016 09:49:35 -0500 Subject: [PATCH 0262/1273] Update apparmor detection --- provisioning/tasks/apparmor.yml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/provisioning/tasks/apparmor.yml b/provisioning/tasks/apparmor.yml index 516ebf054..80f7125bd 100644 --- a/provisioning/tasks/apparmor.yml +++ b/provisioning/tasks/apparmor.yml @@ -1,8 +1,9 @@ --- -- name: Detect if AppArmor is installed. - stat: - path: /etc/init.d/apparmor - register: apparmor_installed +- name: Detect if AppArmor is loaded. + command: apparmor_status + register: apparmor_status + failed_when: false + changed_when: false - name: Ensure MySQL AppArmor profile is disabled (for slow query log). file: @@ -10,7 +11,7 @@ src: /etc/apparmor.d/usr.sbin.mysqld state: link register: mysql_apparmor - when: mysql_slow_query_log_enabled and apparmor_installed.stat.exists + when: "mysql_slow_query_log_enabled and apparmor_status.stdout is defined and 'is loaded' in apparmor_status.stdout" - name: Restart the AppArmor if necessary. service: name=apparmor state=restarted From 85dd47df9be648d4b30db3c1bd09531ba6baccd1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oskar=20Sch=C3=B6ldstr=C3=B6m?= <public@oxy.fi> Date: Sat, 14 May 2016 10:07:29 -0500 Subject: [PATCH 0263/1273] Ignore apparmor tasks if service is not working --- provisioning/tasks/apparmor.yml | 6 +++--- tests/Dockerfile.ubuntu-16.04 | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/provisioning/tasks/apparmor.yml b/provisioning/tasks/apparmor.yml index 80f7125bd..fc8711da0 100644 --- a/provisioning/tasks/apparmor.yml +++ b/provisioning/tasks/apparmor.yml @@ -1,6 +1,6 @@ --- -- name: Detect if AppArmor is loaded. - command: apparmor_status +- name: Detect if AppArmor is working. + command: service apparmor status register: apparmor_status failed_when: false changed_when: false @@ -11,7 +11,7 @@ src: /etc/apparmor.d/usr.sbin.mysqld state: link register: mysql_apparmor - when: "mysql_slow_query_log_enabled and apparmor_status.stdout is defined and 'is loaded' in apparmor_status.stdout" + when: "mysql_slow_query_log_enabled and apparmor_status.rc == 0" - name: Restart the AppArmor if necessary. service: name=apparmor state=restarted diff --git a/tests/Dockerfile.ubuntu-16.04 b/tests/Dockerfile.ubuntu-16.04 index bd524d0da..9313987fb 100644 --- a/tests/Dockerfile.ubuntu-16.04 +++ b/tests/Dockerfile.ubuntu-16.04 @@ -7,7 +7,7 @@ RUN apt-get install -y software-properties-common git # https://github.com/ansible/ansible/issues/15524 # RUN apt-add-repository -y ppa:ansible/ansible RUN apt-get update -RUN apt-get install -y ansible ufw curl apparmor apparmor-profiles +RUN apt-get install -y ansible ufw curl COPY initctl_faker . RUN chmod +x initctl_faker && rm -fr /sbin/initctl && ln -s /initctl_faker /sbin/initctl From 4fc722e30dff6f923b129395fd5e9a801f24aae5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oskar=20Sch=C3=B6ldstr=C3=B6m?= <public@oxy.fi> Date: Sat, 14 May 2016 10:20:07 -0500 Subject: [PATCH 0264/1273] Update PHP 5.6 configurations [ci skip] --- docs/other/php-56.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/docs/other/php-56.md b/docs/other/php-56.md index c91374a99..946f8b7c4 100644 --- a/docs/other/php-56.md +++ b/docs/other/php-56.md @@ -34,8 +34,14 @@ php_extension_conf_paths: php_fpm_daemon: php5-fpm php_fpm_conf_path: "/etc/php5/fpm" php_mysql_package: php5-mysql +php_memcached_package: php5-memcached + +xhprof_download_url: https://github.com/phacility/xhprof/archive/master.tar.gz +xhprof_download_folder_name: xhprof-master ``` +If you're using Apache with `mod_php` you should also add `libapache2-mod-php5` to the `php_packages` list. + ## RedHat/CentOS 7 Remi's RPM repository is included with Drupal VM, and you can make the following changes to use it to install PHP 5.6 instead of 7: From c74ce96458f7c3b6fea4f92baf13baa62e96781b Mon Sep 17 00:00:00 2001 From: Jeff Geerling <geerlingguy@mac.com> Date: Fri, 13 May 2016 17:10:54 -0500 Subject: [PATCH 0265/1273] Issue #616: Re-enable the XHProf integration test. --- .travis.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index cfc1ae5d3..99c431c5d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -84,11 +84,11 @@ script: && (echo 'Pimp my Log install pass' && exit 0) || (echo 'Pimp my Log install fail' && exit 1) - # - > - # sudo docker exec "$(cat ${container_id})" curl -s --header Host:xhprof.${HOSTNAME} localhost - # | grep -q '<title>XHProf' - # && (echo 'XHProf install pass' && exit 0) - # || (echo 'XHProf install fail' && exit 1) + - > + sudo docker exec "$(cat ${container_id})" curl -s --header Host:xhprof.${HOSTNAME} localhost + | grep -q '<title>XHProf' + && (echo 'XHProf install pass' && exit 0) + || (echo 'XHProf install fail' && exit 1) - > sudo docker exec "$(cat ${container_id})" curl -s localhost:8025 From 554bf2c91dae0314e94867a1fc0db396a6e0df5c Mon Sep 17 00:00:00 2001 From: Jeff Geerling <geerlingguy@mac.com> Date: Fri, 13 May 2016 23:11:49 -0500 Subject: [PATCH 0266/1273] Install xhprof when testing. --- tests/local.config.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/local.config.yml b/tests/local.config.yml index 3344edd2f..0a5484114 100644 --- a/tests/local.config.yml +++ b/tests/local.config.yml @@ -1,2 +1,10 @@ --- composer_home_path: "/{{ drupalvm_user }}/.composer" + +installed_extras: + - adminer + - drupalconsole + - mailhog + - pimpmylog + - varnish + - xhprof From 5cc599f3e775db4308960d2597d8f1f8a2a0ea9a Mon Sep 17 00:00:00 2001 From: Jeff Geerling <geerlingguy@mac.com> Date: Sat, 14 May 2016 21:27:01 -0500 Subject: [PATCH 0267/1273] Issue #522: Document PHP5 SQLite module for PHP 5.x on Debian. --- docs/other/php-56.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/other/php-56.md b/docs/other/php-56.md index 946f8b7c4..0d5726214 100644 --- a/docs/other/php-56.md +++ b/docs/other/php-56.md @@ -21,6 +21,7 @@ php_packages: - php5-dev - php5-fpm - php5-gd + - php5-sqlite - php-pear - libpcre3-dev php_conf_paths: From 3fcd2c0ba63067c503609e3bc8385a836358e120 Mon Sep 17 00:00:00 2001 From: Jeff Geerling <geerlingguy@mac.com> Date: Sat, 14 May 2016 21:29:30 -0500 Subject: [PATCH 0268/1273] Fixes #522: Add SQLite to Drupal VM. --- README.md | 1 + example.config.yml | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 134340329..bf5abc30f 100644 --- a/README.md +++ b/README.md @@ -22,6 +22,7 @@ It will install the following on an Ubuntu 16.04 (by default) linux VM: - Ruby - Memcached - Redis + - SQLite - XHProf, for profiling your code - Blackfire, for profiling your code - XDebug, for debugging your code diff --git a/example.config.yml b/example.config.yml index 7d4dcb602..c36529e95 100644 --- a/example.config.yml +++ b/example.config.yml @@ -168,7 +168,8 @@ installed_extras: # - xhprof # Add any extra apt or yum packages you would like installed. -extra_packages: [] +extra_packages: + - sqlite # `nodejs` must be in installed_extras for this to work. Valid examples: "0.10", # "0.12", "4.x", "5.x". From 143eed451649effbb1aad29dc24a3afe015ef3d7 Mon Sep 17 00:00:00 2001 From: Jeff Geerling <geerlingguy@mac.com> Date: Sat, 14 May 2016 21:49:51 -0500 Subject: [PATCH 0269/1273] Issue #616: Add XHProf for all tests. --- tests/ubuntu-16-nginx.config.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/ubuntu-16-nginx.config.yml b/tests/ubuntu-16-nginx.config.yml index 35deff7cc..525fedad3 100644 --- a/tests/ubuntu-16-nginx.config.yml +++ b/tests/ubuntu-16-nginx.config.yml @@ -1,3 +1,11 @@ --- composer_home_path: "/{{ drupalvm_user }}/.composer" drupalvm_webserver: nginx + +installed_extras: + - adminer + - drupalconsole + - mailhog + - pimpmylog + - varnish + - xhprof From b6fdaefe5a24cfaa58f6bc90dfcfad55521a4838 Mon Sep 17 00:00:00 2001 From: Jeff Geerling <geerlingguy@mac.com> Date: Sat, 14 May 2016 21:54:11 -0500 Subject: [PATCH 0270/1273] Add local.config.yml to gitignore. --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 3958f643a..ee6483792 100644 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,7 @@ .bundle/ *.retry vagrant_ansible_inventory_default +local.config.yml config.yml drupal.make.yml Vagrantfile.local From e8a0191b1a936121943e4862c293ee9ffd0d90f9 Mon Sep 17 00:00:00 2001 From: Jeff Geerling <geerlingguy@mac.com> Date: Sat, 14 May 2016 22:00:57 -0500 Subject: [PATCH 0271/1273] Update role requirements for PHP 3.0.3 role version - for SQLite support. --- provisioning/requirements.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/provisioning/requirements.yml b/provisioning/requirements.yml index 5bb78e58b..c232939ca 100644 --- a/provisioning/requirements.yml +++ b/provisioning/requirements.yml @@ -36,7 +36,7 @@ - src: geerlingguy.nodejs version: 3.0.0 - src: geerlingguy.php - version: 3.0.2 + version: 3.0.3 - src: geerlingguy.php-memcached version: 2.0.0 - src: geerlingguy.php-mysql From 58f8722c36ad0ac0e2357a5cc3d6fe1aab2ffc06 Mon Sep 17 00:00:00 2001 From: Jeff Geerling <geerlingguy@mac.com> Date: Sat, 14 May 2016 22:21:00 -0500 Subject: [PATCH 0272/1273] Update to JJG-Ansible-Windows 2.0.0. --- Vagrantfile | 2 +- provisioning/JJG-Ansible-Windows/README.md | 2 +- provisioning/JJG-Ansible-Windows/windows.sh | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Vagrantfile b/Vagrantfile index ffac05663..4a9dd83f0 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -118,7 +118,7 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| else config.vm.provision 'shell' do |sh| sh.path = "#{dir}/provisioning/JJG-Ansible-Windows/windows.sh" - sh.args = '/provisioning/playbook.yml' + sh.args = '/vagrant/provisioning/playbook.yml' end end # ansible_local provisioner is broken in Vagrant < 1.8.2. diff --git a/provisioning/JJG-Ansible-Windows/README.md b/provisioning/JJG-Ansible-Windows/README.md index c64b4a664..e7548efaf 100644 --- a/provisioning/JJG-Ansible-Windows/README.md +++ b/provisioning/JJG-Ansible-Windows/README.md @@ -20,7 +20,7 @@ if is_windows # Provisioning configuration for shell script. config.vm.provision "shell" do |sh| sh.path = "provisioning/JJG-Ansible-Windows/windows.sh" - sh.args = "provisioning/playbook.yml" + sh.args = "/vagrant/provisioning/playbook.yml" end else # Provisioning configuration for Ansible (for Mac/Linux hosts). diff --git a/provisioning/JJG-Ansible-Windows/windows.sh b/provisioning/JJG-Ansible-Windows/windows.sh index bab2355b0..1cc2a749a 100644 --- a/provisioning/JJG-Ansible-Windows/windows.sh +++ b/provisioning/JJG-Ansible-Windows/windows.sh @@ -34,7 +34,7 @@ YUM=$(which yum 2>/dev/null) APT_GET=$(which apt-get 2>/dev/null) # Make sure Ansible playbook exists. -if [ ! -f "/vagrant/$ANSIBLE_PLAYBOOK" ]; then +if [ ! -f "$ANSIBLE_PLAYBOOK" ]; then echo "Cannot find Ansible playbook." exit 1 fi @@ -72,8 +72,8 @@ fi # Install requirements. echo "Installing Ansible roles from requirements file, if available." -find "/vagrant/$PLAYBOOK_DIR" \( -name "requirements.yml" -o -name "requirements.txt" \) -exec sudo ansible-galaxy install --force --ignore-errors -r {} \; +find "$PLAYBOOK_DIR" \( -name "requirements.yml" -o -name "requirements.txt" \) -exec sudo ansible-galaxy install --force --ignore-errors -r {} \; # Run the playbook. echo "Running Ansible provisioner defined in Vagrantfile." -ansible-playbook -i 'localhost,' "/vagrant/${ANSIBLE_PLAYBOOK}" --extra-vars "${extra_vars[*]}" --connection=local +ansible-playbook -i 'localhost,' "${ANSIBLE_PLAYBOOK}" --extra-vars "${extra_vars[*]}" --connection=local From 5090b1efb35af59c86595dbafc1c17187ac822fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oskar=20Sch=C3=B6ldstr=C3=B6m?= <public@oxy.fi> Date: Sat, 30 Apr 2016 13:46:48 -0500 Subject: [PATCH 0273/1273] Add support for storing drupal vm in a subdirectory --- Vagrantfile | 42 ++++++++++------- docs/other/drupalvm-in-subdirectory.md | 64 ++++++++++++++++++++++++++ mkdocs.yml | 1 + provisioning/playbook.yml | 2 +- 4 files changed, 92 insertions(+), 17 deletions(-) create mode 100644 docs/other/drupalvm-in-subdirectory.md diff --git a/Vagrantfile b/Vagrantfile index 4a9dd83f0..2863a3a03 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -24,17 +24,21 @@ def walk(obj, &fn) end end +require 'pathname' +host_drupalvm_root = File.dirname(File.expand_path(__FILE__)) +host_project_root = ENV['DRUPALVM_PROJECT_ROOT'] || host_drupalvm_root +guest_drupalvm_root = "/vagrant/#{Pathname.new(host_drupalvm_root).relative_path_from(Pathname.new(host_project_root))}" +guest_project_root = '/vagrant' + +host_vconfig_path = ENV['DRUPALVM_CONFIG'] ? "#{host_project_root}/#{ENV['DRUPALVM_CONFIG']}" : "#{host_drupalvm_root}/config.yml" +guest_vconfig_path = ENV['DRUPALVM_CONFIG'] ? "#{guest_project_root}/#{ENV['DRUPALVM_CONFIG']}" : "#{guest_drupalvm_root}/config.yml" + # Use config.yml and local.config.yml for VM configuration. require 'yaml' -dir = File.dirname(File.expand_path(__FILE__)) -unless File.exist?("#{dir}/config.yml") +unless File.exist?(host_vconfig_path) raise 'Configuration file not found! Please copy example.config.yml to config.yml and try again.' end -vconfig = YAML.load_file("#{dir}/config.yml") -# Include a local.config.yml file if available. -if File.exist?("#{dir}/local.config.yml") - vconfig.merge!(YAML.load_file("#{dir}/local.config.yml")) -end +vconfig = YAML.load_file(host_vconfig_path) # Replace jinja variables in config. vconfig = walk(vconfig) do |value| @@ -107,32 +111,38 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| end # Allow override of the default synced folder type. - config.vm.synced_folder '.', '/vagrant', type: vconfig.include?('vagrant_synced_folder_default_type') ? vconfig['vagrant_synced_folder_default_type'] : 'nfs' + config.vm.synced_folder host_project_root, '/vagrant', type: vconfig.include?('vagrant_synced_folder_default_type') ? vconfig['vagrant_synced_folder_default_type'] : 'nfs' # Provisioning. Use ansible if it's installed, JJG-Ansible-Windows if not. if which('ansible-playbook') config.vm.provision 'ansible' do |ansible| - ansible.playbook = "#{dir}/provisioning/playbook.yml" - ansible.galaxy_role_file = "#{dir}/provisioning/requirements.yml" + ansible.playbook = "#{host_drupalvm_root}/provisioning/playbook.yml" + ansible.galaxy_role_file = "#{host_drupalvm_root}/provisioning/requirements.yml" + ansible.extra_vars = { + config_file: host_vconfig_path + } end else config.vm.provision 'shell' do |sh| - sh.path = "#{dir}/provisioning/JJG-Ansible-Windows/windows.sh" - sh.args = '/vagrant/provisioning/playbook.yml' + sh.path = "#{host_drupalvm_root}/provisioning/JJG-Ansible-Windows/windows.sh" + sh.args = "-e 'config_file=#{guest_vconfig_path}' #{guest_drupalvm_root}/provisioning/playbook.yml" end end # ansible_local provisioner is broken in Vagrant < 1.8.2. # else # config.vm.provision "ansible_local" do |ansible| - # ansible.playbook = "provisioning/playbook.yml" - # ansible.galaxy_role_file = "provisioning/requirements.yml" + # ansible.playbook = "#{guest_drupalvm_root}/provisioning/playbook.yml" + # ansible.galaxy_role_file = "#{guest_drupalvm_root}/provisioning/requirements.yml" + # ansible.extra_vars = { + # config_file: guest_vconfig_path + # } # end # end # VMware Fusion. config.vm.provider :vmware_fusion do |v, override| # HGFS kernel module currently doesn't load correctly for native shares. - override.vm.synced_folder '.', '/vagrant', type: 'nfs' + override.vm.synced_folder host_project_root, '/vagrant', type: 'nfs' v.gui = false v.vmx['memsize'] = vconfig['vagrant_memory'] @@ -162,5 +172,5 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| config.vm.define vconfig['vagrant_machine_name'] # Allow an untracked Vagrantfile to modify the configurations - eval File.read 'Vagrantfile.local' if File.exist?('Vagrantfile.local') + eval File.read "#{host_project_root}/Vagrantfile.local" if File.exist?("#{host_project_root}/Vagrantfile.local") end diff --git a/docs/other/drupalvm-in-subdirectory.md b/docs/other/drupalvm-in-subdirectory.md new file mode 100644 index 000000000..2016a31ce --- /dev/null +++ b/docs/other/drupalvm-in-subdirectory.md @@ -0,0 +1,64 @@ +To make it easier bringing in Drupal VM updates to an existing project, you might consider a slightly more complex setup. Instead of mixing your project's files with Drupal VM's configuration files, you can separate the two with the help of a delegating `Vagrantfile`. + +### Steps for setting up a decoupled project structure: + +Add Drupal VM as a git submodule (or other) to a subdirectory, in this case we'll name the subdirectory `box/`. + +``` +├── docroot +│ ├── ... +│ └── index.php +└── box + ├── ... + ├── example.config.yml + └── Vagrantfile +``` + +Add an configure the `config.yml` anywhere you like, in this example we'll place it in `config/drupalvm.config.yml`. + +``` +├── config +│ ├── ... +│ └── drupalvm.config.yml +├── docroot +│ ├── ... +│ └── index.php +└── box + ├── ... + ├── example.config.yml + └── Vagrantfile +``` + +Create a delegating `Vagrantfile` with the environment variables `DRUPALVM_PROJECT_ROOT` and `DRUPALVM_CONFIG`. Place this file in your project's root directory. + +```ruby +# The absolute path to the root directory of the project. Both Drupal VM and +# the config file need to be contained within this path. +ENV['DRUPALVM_PROJECT_ROOT'] = "#{__dir__}" +# The relative path from the project root to to config file. +ENV['DRUPALVM_CONFIG'] = "config/drupalvm.config.yml" +# Load the real Vagrantfile +load "#{__dir__}/box/Vagrantfile" +``` + +``` +├───Vagrantfile +├── config +│ ├── ... +│ └── drupalvm.config.yml +├── docroot +│ ├── ... +│ └── index.php +└── box + ├── ... + ├── example.config.yml + └── Vagrantfile +``` + +When you issue `vagrant` commands anywhere in your project tree this file will be detected and used as a delegator for Drupal VM's own Vagrantfile. + +Finally, provision the VM using the delegating `Vagrantfile`. _Important_, you should never issue `vagrant` commands through the `box/Vagrantfile` directly. If you do, it will create a secondary VM in the `box/` directory. + +```sh +vagrant up +``` diff --git a/mkdocs.yml b/mkdocs.yml index 0bea536fb..c9abe7daf 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -42,3 +42,4 @@ pages: - 'Linux Notes': 'other/linux.md' - 'Windows Notes': 'other/windows.md' - 'Vagrant and VirtualBox Tips': 'other/vagrant-virtualbox.md' + - 'Storing Drupal VM in a subdirectory': 'other/drupalvm-in-subdirectory.md' diff --git a/provisioning/playbook.yml b/provisioning/playbook.yml index aa4ebbd63..2aba42455 100644 --- a/provisioning/playbook.yml +++ b/provisioning/playbook.yml @@ -4,9 +4,9 @@ vars_files: - vars/main.yml - - ../config.yml pre_tasks: + - include_vars: "{{ config_file | default('../config.yml') }}" - include_vars: "{{ item }}" with_fileglob: - ../../local.config.yml From 1ba43a740290ed126c99b3a5fb4e8ecc0959cf7c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oskar=20Sch=C3=B6ldstr=C3=B6m?= <public@oxy.fi> Date: Fri, 13 May 2016 11:41:45 -0500 Subject: [PATCH 0274/1273] Fix conflicts and update logic to use a config directory instead --- Vagrantfile | 49 ++++--- docs/other/drupalvm-composer-dependency.md | 147 +++++++++++++++++++++ docs/other/drupalvm-in-subdirectory.md | 64 --------- mkdocs.yml | 2 +- provisioning/playbook.yml | 7 +- 5 files changed, 180 insertions(+), 89 deletions(-) create mode 100644 docs/other/drupalvm-composer-dependency.md delete mode 100644 docs/other/drupalvm-in-subdirectory.md diff --git a/Vagrantfile b/Vagrantfile index 2863a3a03..3873ee00d 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -2,6 +2,16 @@ # vi: set ft=ruby : VAGRANTFILE_API_VERSION = '2' +# Absolute paths on the host machine. +host_drupalvm_dir = File.dirname(File.expand_path(__FILE__)) +host_project_dir = ENV['DRUPALVM_PROJECT_ROOT'] || host_drupalvm_dir +host_config_dir = ENV['DRUPALVM_CONFIG_DIR'] ? "#{host_project_dir}/#{ENV['DRUPALVM_CONFIG_DIR']}" : host_project_dir + +# Absolute paths on the guest machine. +guest_project_dir = '/vagrant' +guest_drupalvm_dir = ENV['DRUPALVM_DIR'] ? "/vagrant/#{ENV['DRUPALVM_DIR']}" : guest_project_dir +guest_config_dir = ENV['DRUPALVM_CONFIG_DIR'] ? "/vagrant/#{ENV['DRUPALVM_CONFIG_DIR']}" : guest_project_dir + # Cross-platform way of finding an executable in the $PATH. def which(cmd) exts = ENV['PATHEXT'] ? ENV['PATHEXT'].split(';') : [''] @@ -24,21 +34,16 @@ def walk(obj, &fn) end end -require 'pathname' -host_drupalvm_root = File.dirname(File.expand_path(__FILE__)) -host_project_root = ENV['DRUPALVM_PROJECT_ROOT'] || host_drupalvm_root -guest_drupalvm_root = "/vagrant/#{Pathname.new(host_drupalvm_root).relative_path_from(Pathname.new(host_project_root))}" -guest_project_root = '/vagrant' - -host_vconfig_path = ENV['DRUPALVM_CONFIG'] ? "#{host_project_root}/#{ENV['DRUPALVM_CONFIG']}" : "#{host_drupalvm_root}/config.yml" -guest_vconfig_path = ENV['DRUPALVM_CONFIG'] ? "#{guest_project_root}/#{ENV['DRUPALVM_CONFIG']}" : "#{guest_drupalvm_root}/config.yml" - # Use config.yml and local.config.yml for VM configuration. require 'yaml' -unless File.exist?(host_vconfig_path) +unless File.exist?("#{host_config_dir}/config.yml") raise 'Configuration file not found! Please copy example.config.yml to config.yml and try again.' end -vconfig = YAML.load_file(host_vconfig_path) +vconfig = YAML.load_file("#{host_config_dir}/config.yml") +# Include a local.config.yml file if available. +if File.exist?("#{host_config_dir}/local.config.yml") + vconfig.merge!(YAML.load_file("#{host_config_dir}/local.config.yml")) +end # Replace jinja variables in config. vconfig = walk(vconfig) do |value| @@ -111,30 +116,30 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| end # Allow override of the default synced folder type. - config.vm.synced_folder host_project_root, '/vagrant', type: vconfig.include?('vagrant_synced_folder_default_type') ? vconfig['vagrant_synced_folder_default_type'] : 'nfs' + config.vm.synced_folder host_project_dir, '/vagrant', type: vconfig.include?('vagrant_synced_folder_default_type') ? vconfig['vagrant_synced_folder_default_type'] : 'nfs' # Provisioning. Use ansible if it's installed, JJG-Ansible-Windows if not. if which('ansible-playbook') config.vm.provision 'ansible' do |ansible| - ansible.playbook = "#{host_drupalvm_root}/provisioning/playbook.yml" - ansible.galaxy_role_file = "#{host_drupalvm_root}/provisioning/requirements.yml" + ansible.playbook = "#{host_drupalvm_dir}/provisioning/playbook.yml" + ansible.galaxy_role_file = "#{host_drupalvm_dir}/provisioning/requirements.yml" ansible.extra_vars = { - config_file: host_vconfig_path + config_dir: host_config_dir } end else config.vm.provision 'shell' do |sh| - sh.path = "#{host_drupalvm_root}/provisioning/JJG-Ansible-Windows/windows.sh" - sh.args = "-e 'config_file=#{guest_vconfig_path}' #{guest_drupalvm_root}/provisioning/playbook.yml" + sh.path = "#{host_drupalvm_dir}/provisioning/JJG-Ansible-Windows/windows.sh" + sh.args = "-e 'config_dir=\"#{guest_config_dir}\"' #{guest_drupalvm_dir}/provisioning/playbook.yml" end end # ansible_local provisioner is broken in Vagrant < 1.8.2. # else # config.vm.provision "ansible_local" do |ansible| - # ansible.playbook = "#{guest_drupalvm_root}/provisioning/playbook.yml" - # ansible.galaxy_role_file = "#{guest_drupalvm_root}/provisioning/requirements.yml" + # ansible.playbook = "#{guest_drupalvm_dir}/provisioning/playbook.yml" + # ansible.galaxy_role_file = "#{guest_drupalvm_dir}/provisioning/requirements.yml" # ansible.extra_vars = { - # config_file: guest_vconfig_path + # config_dir: guest_config_dir # } # end # end @@ -142,7 +147,7 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| # VMware Fusion. config.vm.provider :vmware_fusion do |v, override| # HGFS kernel module currently doesn't load correctly for native shares. - override.vm.synced_folder host_project_root, '/vagrant', type: 'nfs' + override.vm.synced_folder host_project_dir, '/vagrant', type: 'nfs' v.gui = false v.vmx['memsize'] = vconfig['vagrant_memory'] @@ -172,5 +177,5 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| config.vm.define vconfig['vagrant_machine_name'] # Allow an untracked Vagrantfile to modify the configurations - eval File.read "#{host_project_root}/Vagrantfile.local" if File.exist?("#{host_project_root}/Vagrantfile.local") + eval File.read "#{host_config_dir}/Vagrantfile.local" if File.exist?("#{host_config_dir}/Vagrantfile.local") end diff --git a/docs/other/drupalvm-composer-dependency.md b/docs/other/drupalvm-composer-dependency.md new file mode 100644 index 000000000..974e3c062 --- /dev/null +++ b/docs/other/drupalvm-composer-dependency.md @@ -0,0 +1,147 @@ +To make future Drupal VM updates easier to integrate with an existing project, you might consider the more complex setup of installing Drupal VM as a `composer` dependency. Using a delegating `Vagrantfile` you are able to run `vagrant` commands anywhere in your project as well as separate your custom configuration files from Drupal VM's own files. + +### Add Drupal VM as a Composer dependency + +Add Drupal VM as a development dependency to your `composer.json`. + +``` +composer require --dev geerlingguy/drupal-vm +``` + +### Setup your configuration files + +Add and configure the `config.yml` anywhere you like, in this example we place it in a `config/` directory. If you're using `build_makefile`, this would also be a good location for the `drupal.make.yml` file. + +_Note: This will be the directory where Drupal VM looks for other local configuration files as well. Such as [`local.config.yml` and `Vagrantfile.local`](overriding-configurations.md)._ + +``` +├── config/ +│ ├── config.yml +│ ├── drupal.make.yml +│ ├── local.config.yml +│ └── Vagrantfile.local +├── docroot/ +│ ├── ... +│ └── index.php +└── vendor/ + ├── ... + └── geerlingguy/ + └── drupal-vm/ +``` + +If you're using `pre_provision_scripts`, `post_provision_scripts` or `drush_makefile_path` you also need to adjust their paths to take into account the new directory structure. The examples used in `example.config.yml` assume the files are located in the Drupal VM directory. + +```yaml +# The default provided in `example.config.yml`: +drush_makefile_path: ../../drupal.make.yml +# With Drupal VM as a Composer dependency: +drush_makefile_path: ../../../../../config/drupal.make.yml + +post_provision_scripts: + # The default provided in `example.config.yml`: + - "../../examples/scripts/configure-solr.sh" + # With Drupal VM as a Composer dependency: + - "../../../../../examples/scripts/configure-solr.sh" +``` + +### Create a delegating `Vagrantfile` + +Create a delegating `Vagrantfile` that will catch all your `vagrant` commands and send them to Drupal VM's own `Vagrantfile`. Place this file in your project's root directory. + +```ruby +# The absolute path to the root directory of the project. Both Drupal VM and +# the config file need to be contained within this path. +ENV['DRUPALVM_PROJECT_ROOT'] = "#{__dir__}" +# The relative path from the project root to the config directory where you +# placed your config.yml file. +ENV['DRUPALVM_CONFIG_DIR'] = "config" +# The relative path from the project root to the directory where Drupal VM is located. +ENV['DRUPALVM_DIR'] = "vendor/geerlingguy/drupal-vm" + +# Load the real Vagrantfile +load "#{__dir__}/#{ENV['DRUPALVM_DIR']}/Vagrantfile" +``` + +When you issue `vagrant` commands anywhere in your project tree this file will be detected and used as a delegator for Drupal VM's own Vagrantfile. + +Your project structure should now look like this: + +``` +├── Vagrantfile +├── composer.json +├── config/ +│ ├── config.yml +│ ├── drupal.make.yml +│ ├── local.config.yml +│ └── Vagrantfile.local +├── docroot/ +│ ├── ... +│ └── index.php +└── vendor/ + ├── ... + └── geerlingguy/ + └── drupal-vm/ +``` + +### Provision the VM + +Finally provision the VM using the delegating `Vagrantfile`. + +```sh +vagrant up +``` + +_Important: you should never issue `vagrant` commands through Drupal VM's own `Vagrantfile` from now on. If you do, it will create a secondary VM in that directory._ + +## Drupal VM without composer + +If you don't use `composer` in your project you can still download Drupal VM (or add it as a git submodule) to any subdirectory in your project. As an example let's name that directory `box/`. + +``` +├── docroot/ +│ ├── ... +│ └── index.php +└── box/ + ├── ... + ├── example.config.yml + └── Vagrantfile +``` + +Configure your `config.yml` like mentioned in the `composer` section above but adjust the paths for this directory structure instead. + +```yaml +# The default provided in `example.config.yml`: +drush_makefile_path: ../../drupal.make.yml +# With Drupal VM in a toplevel subdirectory +drush_makefile_path: ../../../config/drupal.make.yml + +post_provision_scripts: + # The default provided in `example.config.yml`: + - "../../examples/scripts/configure-solr.sh" + # With Drupal VM in a toplevel subdirectory + - "../../../examples/scripts/configure-solr.sh" +``` + +Your directory structure should now look like this: + +``` +├── Vagrantfile +├── config/ +│ ├── drupal.make.yml +│ ├── config.yml +│ ├── local.config.yml +│ └── Vagrantfile.local +├── docroot/ +│ ├── ... +│ └── index.php +└── box/ + ├── ... + ├── example.config.yml + └── Vagrantfile +``` + +Provision the VM using the delegating `Vagrantfile`. + +```sh +vagrant up +``` diff --git a/docs/other/drupalvm-in-subdirectory.md b/docs/other/drupalvm-in-subdirectory.md deleted file mode 100644 index 2016a31ce..000000000 --- a/docs/other/drupalvm-in-subdirectory.md +++ /dev/null @@ -1,64 +0,0 @@ -To make it easier bringing in Drupal VM updates to an existing project, you might consider a slightly more complex setup. Instead of mixing your project's files with Drupal VM's configuration files, you can separate the two with the help of a delegating `Vagrantfile`. - -### Steps for setting up a decoupled project structure: - -Add Drupal VM as a git submodule (or other) to a subdirectory, in this case we'll name the subdirectory `box/`. - -``` -├── docroot -│ ├── ... -│ └── index.php -└── box - ├── ... - ├── example.config.yml - └── Vagrantfile -``` - -Add an configure the `config.yml` anywhere you like, in this example we'll place it in `config/drupalvm.config.yml`. - -``` -├── config -│ ├── ... -│ └── drupalvm.config.yml -├── docroot -│ ├── ... -│ └── index.php -└── box - ├── ... - ├── example.config.yml - └── Vagrantfile -``` - -Create a delegating `Vagrantfile` with the environment variables `DRUPALVM_PROJECT_ROOT` and `DRUPALVM_CONFIG`. Place this file in your project's root directory. - -```ruby -# The absolute path to the root directory of the project. Both Drupal VM and -# the config file need to be contained within this path. -ENV['DRUPALVM_PROJECT_ROOT'] = "#{__dir__}" -# The relative path from the project root to to config file. -ENV['DRUPALVM_CONFIG'] = "config/drupalvm.config.yml" -# Load the real Vagrantfile -load "#{__dir__}/box/Vagrantfile" -``` - -``` -├───Vagrantfile -├── config -│ ├── ... -│ └── drupalvm.config.yml -├── docroot -│ ├── ... -│ └── index.php -└── box - ├── ... - ├── example.config.yml - └── Vagrantfile -``` - -When you issue `vagrant` commands anywhere in your project tree this file will be detected and used as a delegator for Drupal VM's own Vagrantfile. - -Finally, provision the VM using the delegating `Vagrantfile`. _Important_, you should never issue `vagrant` commands through the `box/Vagrantfile` directly. If you do, it will create a secondary VM in the `box/` directory. - -```sh -vagrant up -``` diff --git a/mkdocs.yml b/mkdocs.yml index c9abe7daf..a802b3eee 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -34,6 +34,7 @@ pages: - 'Using Different Base OSes': 'other/base-os.md' - 'Using Different Webservers': 'other/webservers.md' - 'Overriding configurations': 'other/overriding-configurations.md' + - 'Installing Drupal VM as a Composer Dependency': 'other/drupalvm-composer-dependency.md' - 'PHP 5.6 on Drupal VM': 'other/php-56.md' - 'BigPipe with Drupal VM': 'other/bigpipe.md' - 'Drupal VM Management Tools': 'other/management-tools.md' @@ -42,4 +43,3 @@ pages: - 'Linux Notes': 'other/linux.md' - 'Windows Notes': 'other/windows.md' - 'Vagrant and VirtualBox Tips': 'other/vagrant-virtualbox.md' - - 'Storing Drupal VM in a subdirectory': 'other/drupalvm-in-subdirectory.md' diff --git a/provisioning/playbook.yml b/provisioning/playbook.yml index 2aba42455..ec66a9284 100644 --- a/provisioning/playbook.yml +++ b/provisioning/playbook.yml @@ -6,10 +6,13 @@ - vars/main.yml pre_tasks: - - include_vars: "{{ config_file | default('../config.yml') }}" + - include_vars: "{{ item }}" + with_items: + - "{{ config_dir | default('..') }}/config.yml" + - include_vars: "{{ item }}" with_fileglob: - - ../../local.config.yml + - "{{ config_dir | default('../..') }}/local.config.yml" - include: tasks/init-debian.yml when: ansible_os_family == 'Debian' From a9817037e7b3f92a71134b4ea91a82bf85df64c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oskar=20Sch=C3=B6ldstr=C3=B6m?= <public@oxy.fi> Date: Fri, 13 May 2016 15:40:19 -0500 Subject: [PATCH 0275/1273] Add composer.json --- composer.json | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 composer.json diff --git a/composer.json b/composer.json new file mode 100644 index 000000000..1cb824071 --- /dev/null +++ b/composer.json @@ -0,0 +1,20 @@ +{ + "name": "geerlingguy/drupal-vm", + "type": "project", + "description": "A VM for local Drupal development, built with Vagrant + Ansible", + "keywords": ["vagrant", "vm", "virtual machine", "drupal"], + "homepage": "http://www.drupalvm.com", + "license": "MIT", + "authors": [ + { + "name": "Jeff Geerling", + "homepage": "http://www.jeffgeerling.com" + } + ], + "support": { + "issues": "https://github.com/geerlingguy/drupal-vm/issues", + "source": "https://github.com/geerlingguy/drupal-vm", + "docs": "http://docs.drupalvm.com" + }, + "require": {} +} From baa20ca870343de4b2a84943b02c9482cdf08255 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oskar=20Sch=C3=B6ldstr=C3=B6m?= <public@oxy.fi> Date: Sat, 14 May 2016 22:07:41 -0500 Subject: [PATCH 0276/1273] Add myself shamelessly as an author to composer.json [ci skip] --- composer.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/composer.json b/composer.json index 1cb824071..8e4b76057 100644 --- a/composer.json +++ b/composer.json @@ -9,6 +9,10 @@ { "name": "Jeff Geerling", "homepage": "http://www.jeffgeerling.com" + }, + { + "name": "Oskar Schöldström", + "homepage": "http://oxy.fi" } ], "support": { From 8aae19414f424ac8eeeffba083f669a6f50e9d49 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oskar=20Sch=C3=B6ldstr=C3=B6m?= <public@oxy.fi> Date: Sun, 15 May 2016 09:03:52 -0500 Subject: [PATCH 0277/1273] Docs: Simplify path configurations with config_dir variable --- docs/other/drupalvm-composer-dependency.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/other/drupalvm-composer-dependency.md b/docs/other/drupalvm-composer-dependency.md index 974e3c062..f6d6c9848 100644 --- a/docs/other/drupalvm-composer-dependency.md +++ b/docs/other/drupalvm-composer-dependency.md @@ -29,19 +29,19 @@ _Note: This will be the directory where Drupal VM looks for other local configur └── drupal-vm/ ``` -If you're using `pre_provision_scripts`, `post_provision_scripts` or `drush_makefile_path` you also need to adjust their paths to take into account the new directory structure. The examples used in `example.config.yml` assume the files are located in the Drupal VM directory. +If you're using `pre_provision_scripts`, `post_provision_scripts` or `drush_makefile_path` you also need to adjust their paths to take into account the new directory structure. The examples used in `example.config.yml` assume the files are located in the Drupal VM directory. If you use relative paths you need to the ascend the directory tree as far as the project root, but using the `config_dir` variable you get the absolute path of where you `config.yml` is located. ```yaml # The default provided in `example.config.yml`: drush_makefile_path: ../../drupal.make.yml # With Drupal VM as a Composer dependency: -drush_makefile_path: ../../../../../config/drupal.make.yml +drush_makefile_path: "{{ config_dir }}/drupal.make.yml" post_provision_scripts: # The default provided in `example.config.yml`: - "../../examples/scripts/configure-solr.sh" # With Drupal VM as a Composer dependency: - - "../../../../../examples/scripts/configure-solr.sh" + - "{{ config_dir }}/../examples/scripts/configure-solr.sh" ``` ### Create a delegating `Vagrantfile` @@ -107,19 +107,19 @@ If you don't use `composer` in your project you can still download Drupal VM (o └── Vagrantfile ``` -Configure your `config.yml` like mentioned in the `composer` section above but adjust the paths for this directory structure instead. +Configure your `config.yml` as mentioned in the [`composer` section](#setup-your-configuration-files) above. ```yaml # The default provided in `example.config.yml`: drush_makefile_path: ../../drupal.make.yml # With Drupal VM in a toplevel subdirectory -drush_makefile_path: ../../../config/drupal.make.yml +drush_makefile_path: "{{ config_dir }}/drupal.make.yml" post_provision_scripts: # The default provided in `example.config.yml`: - "../../examples/scripts/configure-solr.sh" # With Drupal VM in a toplevel subdirectory - - "../../../examples/scripts/configure-solr.sh" + - "{{ config_dir }}/../examples/scripts/configure-solr.sh" ``` Your directory structure should now look like this: From 9b35344b0f20e7ecfa35fadca7bd2dbdfb8a5092 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oskar=20Sch=C3=B6ldstr=C3=B6m?= <public@oxy.fi> Date: Sun, 15 May 2016 09:19:15 -0500 Subject: [PATCH 0278/1273] Cleanup config_dir usage --- provisioning/playbook.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/provisioning/playbook.yml b/provisioning/playbook.yml index ec66a9284..1d8790160 100644 --- a/provisioning/playbook.yml +++ b/provisioning/playbook.yml @@ -6,13 +6,18 @@ - vars/main.yml pre_tasks: + - name: Define config_dir. + set_fact: + config_dir: "{{ playbook_dir }}/.." + when: config_dir is not defined + - include_vars: "{{ item }}" with_items: - - "{{ config_dir | default('..') }}/config.yml" + - "{{ config_dir }}/config.yml" - include_vars: "{{ item }}" with_fileglob: - - "{{ config_dir | default('../..') }}/local.config.yml" + - "{{ config_dir }}/local.config.yml" - include: tasks/init-debian.yml when: ansible_os_family == 'Debian' From b793d0d565705bd2f439c51f3772421976b18d14 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oskar=20Sch=C3=B6ldstr=C3=B6m?= <public@oxy.fi> Date: Sun, 15 May 2016 09:44:42 -0500 Subject: [PATCH 0279/1273] Add travis test for specifying a different config_dir --- .travis.yml | 26 ++++++++++++++++++-------- tests/ubuntu-16-nginx.config.yml | 2 ++ 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/.travis.yml b/.travis.yml index 99c431c5d..771c664f3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,6 +8,7 @@ env: HOSTNAME: drupalvm.dev MACHINE_NAME: drupalvm IP: 192.168.88.88 + DRUPALVM_DIR: /var/www/drupalvm matrix: - distribution: ubuntu version: 16.04 @@ -18,6 +19,7 @@ env: init: /sbin/init run_opts: "--privileged" local_config: ubuntu-16-nginx.config.yml + config_dir: /var/www/drupalvm/config - distribution: centos version: 7 init: /usr/lib/systemd/systemd @@ -38,32 +40,40 @@ script: - container_id=$(mktemp) # Run container in detached state - - 'sudo docker run --detach --volume="${PWD}":/var/www/drupalvm/:rw ${run_opts} ${distribution}-${version}:ansible "${init}" > "${container_id}"' + - 'sudo docker run --detach --volume="${PWD}":${DRUPALVM_DIR}/:rw ${run_opts} ${distribution}-${version}:ansible "${init}" > "${container_id}"' # Set hostname. - 'sudo docker exec "$(cat ${container_id})" hostname ${HOSTNAME}' # Setup directories. - - 'sudo docker exec "$(cat ${container_id})" mkdir -p /var/www/drupalvm/drupal' + - 'sudo docker exec "$(cat ${container_id})" mkdir -p ${DRUPALVM_DIR}/drupal' # Install dependencies. - - 'sudo docker exec "$(cat ${container_id})" ansible-galaxy install -r /var/www/drupalvm/provisioning/requirements.yml' + - 'sudo docker exec "$(cat ${container_id})" ansible-galaxy install -r ${DRUPALVM_DIR}/provisioning/requirements.yml' + + # Setup config directory. + - '[[ ! -z "${config_dir}" ]] && sudo docker exec "$(cat ${container_id})" mkdir -p ${config_dir} || true' # Copy configuration files into place. - - 'sudo docker exec "$(cat ${container_id})" cp /var/www/drupalvm/$CONFIG /var/www/drupalvm/config.yml' - - 'sudo docker exec "$(cat ${container_id})" cp /var/www/drupalvm/$MAKEFILE /var/www/drupalvm/drupal.make.yml' + - 'sudo docker exec "$(cat ${container_id})" cp ${DRUPALVM_DIR}/${CONFIG} ${config_dir:-$DRUPALVM_DIR}/config.yml' + - 'sudo docker exec "$(cat ${container_id})" cp ${DRUPALVM_DIR}/${MAKEFILE} ${config_dir:-$DRUPALVM_DIR}/drupal.make.yml' # Override configuration variables. - - 'sudo docker exec "$(cat ${container_id})" bash -c "cp /var/www/drupalvm/tests/${local_config:-local.config.yml} /var/www/drupalvm/local.config.yml" || true' + - 'sudo docker exec "$(cat ${container_id})" bash -c "cp ${DRUPALVM_DIR}/tests/${local_config:-local.config.yml} ${config_dir:-$DRUPALVM_DIR}/local.config.yml"' # Vagrantfile syntax check - 'rubocop --except LineLength,Eval,MutableConstant' # Ansible syntax check. - - 'sudo docker exec --tty "$(cat ${container_id})" env TERM=xterm ansible-playbook /var/www/drupalvm/provisioning/playbook.yml --syntax-check' + - 'sudo docker exec --tty "$(cat ${container_id})" env TERM=xterm ansible-playbook ${DRUPALVM_DIR}/provisioning/playbook.yml --syntax-check' # Run the playbook with ansible-playbook. - - 'sudo docker exec --tty "$(cat ${container_id})" env TERM=xterm ansible-playbook /var/www/drupalvm/provisioning/playbook.yml' + - > + if [ ! -z "${config_dir}" ]; then + sudo docker exec --tty "$(cat ${container_id})" env TERM=xterm ansible-playbook ${DRUPALVM_DIR}/provisioning/playbook.yml --extra-vars="config_dir=${config_dir}"; + else + sudo docker exec --tty "$(cat ${container_id})" env TERM=xterm ansible-playbook ${DRUPALVM_DIR}/provisioning/playbook.yml; + fi # Run the integration tests - > diff --git a/tests/ubuntu-16-nginx.config.yml b/tests/ubuntu-16-nginx.config.yml index 525fedad3..d90a143e1 100644 --- a/tests/ubuntu-16-nginx.config.yml +++ b/tests/ubuntu-16-nginx.config.yml @@ -1,5 +1,7 @@ --- composer_home_path: "/{{ drupalvm_user }}/.composer" +drush_makefile_path: "{{ config_dir }}/drupal.make.yml" + drupalvm_webserver: nginx installed_extras: From 14ac7b53b885d0cf92608be6b958b5a227dfa0d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oskar=20Sch=C3=B6ldstr=C3=B6m?= <public@oxy.fi> Date: Sun, 15 May 2016 10:09:04 -0500 Subject: [PATCH 0280/1273] Default drush_makefile_path to the config_dir --- docs/other/drupalvm-composer-dependency.md | 14 ++------------ example.config.yml | 2 +- tests/ubuntu-16-nginx.config.yml | 2 -- 3 files changed, 3 insertions(+), 15 deletions(-) diff --git a/docs/other/drupalvm-composer-dependency.md b/docs/other/drupalvm-composer-dependency.md index f6d6c9848..ae4b305f1 100644 --- a/docs/other/drupalvm-composer-dependency.md +++ b/docs/other/drupalvm-composer-dependency.md @@ -10,7 +10,7 @@ composer require --dev geerlingguy/drupal-vm ### Setup your configuration files -Add and configure the `config.yml` anywhere you like, in this example we place it in a `config/` directory. If you're using `build_makefile`, this would also be a good location for the `drupal.make.yml` file. +Add and configure the `config.yml` anywhere you like, in this example we place it in a `config/` directory. If you're using `build_makefile` this will be the default location Drupal VM looks for the `drupal.make.yml` file. _Note: This will be the directory where Drupal VM looks for other local configuration files as well. Such as [`local.config.yml` and `Vagrantfile.local`](overriding-configurations.md)._ @@ -29,14 +29,9 @@ _Note: This will be the directory where Drupal VM looks for other local configur └── drupal-vm/ ``` -If you're using `pre_provision_scripts`, `post_provision_scripts` or `drush_makefile_path` you also need to adjust their paths to take into account the new directory structure. The examples used in `example.config.yml` assume the files are located in the Drupal VM directory. If you use relative paths you need to the ascend the directory tree as far as the project root, but using the `config_dir` variable you get the absolute path of where you `config.yml` is located. +If you're using `pre_provision_scripts` or `post_provision_scripts` you also need to adjust their paths to take into account the new directory structure. The examples used in `example.config.yml` assume the files are located in the Drupal VM directory. If you use relative paths you need to the ascend the directory tree as far as the project root, but using the `config_dir` variable you get the absolute path of where you `config.yml` is located. ```yaml -# The default provided in `example.config.yml`: -drush_makefile_path: ../../drupal.make.yml -# With Drupal VM as a Composer dependency: -drush_makefile_path: "{{ config_dir }}/drupal.make.yml" - post_provision_scripts: # The default provided in `example.config.yml`: - "../../examples/scripts/configure-solr.sh" @@ -110,11 +105,6 @@ If you don't use `composer` in your project you can still download Drupal VM (o Configure your `config.yml` as mentioned in the [`composer` section](#setup-your-configuration-files) above. ```yaml -# The default provided in `example.config.yml`: -drush_makefile_path: ../../drupal.make.yml -# With Drupal VM in a toplevel subdirectory -drush_makefile_path: "{{ config_dir }}/drupal.make.yml" - post_provision_scripts: # The default provided in `example.config.yml`: - "../../examples/scripts/configure-solr.sh" diff --git a/example.config.yml b/example.config.yml index c36529e95..9e5255fa1 100644 --- a/example.config.yml +++ b/example.config.yml @@ -37,7 +37,7 @@ drupalvm_webserver: apache # Set this to false if you are using a different site deployment strategy and # would like to configure 'vagrant_synced_folders' and 'apache_vhosts' manually. build_makefile: true -drush_makefile_path: ../../drupal.make.yml +drush_makefile_path: "{{ config_dir }}/drupal.make.yml" # Set this to false if you don't need to install drupal (using the drupal_* # settings below), but instead copy down a database (e.g. using drush sql-sync). diff --git a/tests/ubuntu-16-nginx.config.yml b/tests/ubuntu-16-nginx.config.yml index d90a143e1..525fedad3 100644 --- a/tests/ubuntu-16-nginx.config.yml +++ b/tests/ubuntu-16-nginx.config.yml @@ -1,7 +1,5 @@ --- composer_home_path: "/{{ drupalvm_user }}/.composer" -drush_makefile_path: "{{ config_dir }}/drupal.make.yml" - drupalvm_webserver: nginx installed_extras: From a4e8225cffc350699ac5a294b8f17614eed9520a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oskar=20Sch=C3=B6ldstr=C3=B6m?= <public@oxy.fi> Date: Sun, 15 May 2016 10:16:27 -0500 Subject: [PATCH 0281/1273] Issue #618: Disable working-copy of drupal core by default --- example.drupal.make.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/example.drupal.make.yml b/example.drupal.make.yml index 8f705de48..bc7db6129 100644 --- a/example.drupal.make.yml +++ b/example.drupal.make.yml @@ -15,7 +15,8 @@ projects: download: # Drupal core branch (e.g. "6.x", "7.x", "8.0.x"). branch: "8.1.x" - working-copy: true + # Uncomment if you need a working git repository of Drupal core. + # working-copy: true # Other modules. devel: "1.x-dev" From c6c0eb11efe9a5aa8b45f6f5f2b4a58f3d090b06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oskar=20Sch=C3=B6ldstr=C3=B6m?= <public@oxy.fi> Date: Sun, 15 May 2016 15:41:25 -0500 Subject: [PATCH 0282/1273] Issue #618: Use the latest stable when downloading drupal core --- example.drupal.make.yml | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/example.drupal.make.yml b/example.drupal.make.yml index bc7db6129..942c48f2d 100644 --- a/example.drupal.make.yml +++ b/example.drupal.make.yml @@ -11,12 +11,14 @@ projects: # Core. drupal: - type: "core" - download: - # Drupal core branch (e.g. "6.x", "7.x", "8.0.x"). - branch: "8.1.x" - # Uncomment if you need a working git repository of Drupal core. - # working-copy: true + version: 8.1 + # Use this if you need a working git repository of Drupal core instead of + # the latest stable. + # type: "core" + # download: + # # Drupal core branch (e.g. "6.x", "7.x", "8.0.x"). + # branch: "8.1.x" + # working-copy: true # Other modules. devel: "1.x-dev" From 62cf3ef83dd27625225666bc68d61453d7b79ae3 Mon Sep 17 00:00:00 2001 From: Thom Toogood <thomtoogood@gmail.com> Date: Sat, 14 May 2016 16:55:06 +1000 Subject: [PATCH 0283/1273] Add support for custom pre/post ansible tasks. --- provisioning/playbook.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/provisioning/playbook.yml b/provisioning/playbook.yml index aa4ebbd63..91606152c 100644 --- a/provisioning/playbook.yml +++ b/provisioning/playbook.yml @@ -21,6 +21,11 @@ with_items: "{{ pre_provision_scripts }}" when: pre_provision_scripts is defined + - include: "{{ item }}" + with_fileglob: + - "{{ custom_pre_tasks_directory }}" + when: custom_pre_tasks_directory is defined + - name: Set the PHP webserver daemon correctly when nginx is in use. set_fact: php_webserver_daemon: nginx @@ -95,3 +100,8 @@ script: "{{ item }}" with_items: "{{ post_provision_scripts }}" when: post_provision_scripts is defined + + - include: "{{ item }}" + with_fileglob: + - "{{ custom_post_tasks_directory }}" + when: custom_post_tasks_directory is defined From 475a7be214c7e24579c91ee4c9bbf798f871c374 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oskar=20Sch=C3=B6ldstr=C3=B6m?= <public@oxy.fi> Date: Sun, 15 May 2016 20:03:40 -0500 Subject: [PATCH 0284/1273] Add docs on pre- and post-provision ansible task files --- docs/extras/scripts.md | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/docs/extras/scripts.md b/docs/extras/scripts.md index cb45c1a13..767c07470 100644 --- a/docs/extras/scripts.md +++ b/docs/extras/scripts.md @@ -1,4 +1,6 @@ -Drupal VM allows you to run extra shell scripts in the beginning and at the end of the provisioning process, in case you need to do extra setup, further configure the VM, or install extra software outside the purview of Drupal VM. +Drupal VM allows you to run extra shell scripts and ansible task files in the beginning and at the end of the provisioning process, in case you need to do extra setup, further configure the VM, or install extra software outside the purview of Drupal VM. + +## Shell scripts To use an extra script, configure the path to the script (relative to `provisioning/playbook.yml`) in `config.yml`: @@ -16,3 +18,18 @@ _Note: The pre provision scripts run before any other packages are installed. If You can define as many scripts as you would like, and any arguments after the path will be passed to the shell script itself (e.g. `"- "../scripts/setup-paths.sh --option"`). Place your pre and post provision scripts inside a `scripts` directory in the root of your Drupal VM project directory; this directory is gitignored, so you can continue to update Drupal VM without overwriting your scripts. + +## Ansible task files + +To use an extra ansible task file, configure the path to the file (relative to `provisioning/files/`) in `config.yml`: + +```yaml +custom_pre_tasks_directory: "../../scripts/pre/*" +custom_post_tasks_directory: "../../scripts/post-provision.yml" +``` + +The path will be evaluated as a [glob pattern](https://docs.python.org/2/library/glob.html) so you can point to a single file or a directory matching a set of files. + +The files matched will run in alphabetical order, and as with shell scripts, pre-provision task files will run before any other packages are installed. + +_Note: Unlike pre- and post-provision scripts, extra task files will be relative to `provisioning/files/` instead of `provisioning/`._ From 0e1d3f031191cc9d1efa493fa7c6e7fa50fef5e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oskar=20Sch=C3=B6ldstr=C3=B6m?= <public@oxy.fi> Date: Sun, 15 May 2016 20:07:02 -0500 Subject: [PATCH 0285/1273] Rename to align with pre- and post provision script variables --- docs/extras/scripts.md | 4 ++-- provisioning/playbook.yml | 14 ++++++++------ 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/docs/extras/scripts.md b/docs/extras/scripts.md index 767c07470..00948a970 100644 --- a/docs/extras/scripts.md +++ b/docs/extras/scripts.md @@ -24,8 +24,8 @@ Place your pre and post provision scripts inside a `scripts` directory in the ro To use an extra ansible task file, configure the path to the file (relative to `provisioning/files/`) in `config.yml`: ```yaml -custom_pre_tasks_directory: "../../scripts/pre/*" -custom_post_tasks_directory: "../../scripts/post-provision.yml" +pre_provision_tasks_dir: "../../scripts/pre/*" +post_provision_tasks_dir: "../../scripts/post-provision.yml" ``` The path will be evaluated as a [glob pattern](https://docs.python.org/2/library/glob.html) so you can point to a single file or a directory matching a set of files. diff --git a/provisioning/playbook.yml b/provisioning/playbook.yml index 91606152c..f36484456 100644 --- a/provisioning/playbook.yml +++ b/provisioning/playbook.yml @@ -21,10 +21,11 @@ with_items: "{{ pre_provision_scripts }}" when: pre_provision_scripts is defined - - include: "{{ item }}" + - name: Run configured pre-provision ansible task files. + include: "{{ item }}" with_fileglob: - - "{{ custom_pre_tasks_directory }}" - when: custom_pre_tasks_directory is defined + - "{{ pre_provision_tasks_dir }}" + when: pre_provision_tasks_dir is defined - name: Set the PHP webserver daemon correctly when nginx is in use. set_fact: @@ -101,7 +102,8 @@ with_items: "{{ post_provision_scripts }}" when: post_provision_scripts is defined - - include: "{{ item }}" + - name: Run configured post-provision ansible task files. + include: "{{ item }}" with_fileglob: - - "{{ custom_post_tasks_directory }}" - when: custom_post_tasks_directory is defined + - "{{ post_provision_tasks_dir }}" + when: post_provision_tasks_dir is defined From 65ebeb1a71d3c0cd7b869b226845db034bf18540 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oskar=20Sch=C3=B6ldstr=C3=B6m?= <public@oxy.fi> Date: Sun, 15 May 2016 21:33:49 -0500 Subject: [PATCH 0286/1273] Fix undefined provision variables not skipping tasks --- provisioning/playbook.yml | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/provisioning/playbook.yml b/provisioning/playbook.yml index f36484456..5eda4be6d 100644 --- a/provisioning/playbook.yml +++ b/provisioning/playbook.yml @@ -18,14 +18,12 @@ - name: Run configured pre-provision shell scripts. script: "{{ item }}" - with_items: "{{ pre_provision_scripts }}" - when: pre_provision_scripts is defined + with_items: "{{ pre_provision_scripts|default(omit) }}" - name: Run configured pre-provision ansible task files. include: "{{ item }}" with_fileglob: - - "{{ pre_provision_tasks_dir }}" - when: pre_provision_tasks_dir is defined + - "{{ pre_provision_tasks_dir|default(omit) }}" - name: Set the PHP webserver daemon correctly when nginx is in use. set_fact: @@ -99,11 +97,9 @@ - name: Run configured post-provision shell scripts. script: "{{ item }}" - with_items: "{{ post_provision_scripts }}" - when: post_provision_scripts is defined + with_items: "{{ post_provision_scripts|default(omit) }}" - name: Run configured post-provision ansible task files. include: "{{ item }}" with_fileglob: - - "{{ post_provision_tasks_dir }}" - when: post_provision_tasks_dir is defined + - "{{ post_provision_tasks_dir|default(omit) }}" From 1deae639aac7f65d92a4065e46571d23e9b5e7bb Mon Sep 17 00:00:00 2001 From: Rodrigo Elizeu Goncalves <rodrigoeg@ciandt.com> Date: Mon, 16 May 2016 19:43:58 -0300 Subject: [PATCH 0287/1273] Issue #635: Documentation for PHP 5.6 does not have php_fpm_pool_conf_path --- docs/other/php-56.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/other/php-56.md b/docs/other/php-56.md index 0d5726214..80112eaa3 100644 --- a/docs/other/php-56.md +++ b/docs/other/php-56.md @@ -34,6 +34,7 @@ php_extension_conf_paths: - /etc/php5/cli/conf.d php_fpm_daemon: php5-fpm php_fpm_conf_path: "/etc/php5/fpm" +php_fpm_pool_conf_path: "/etc/php5/fpm/pool.d/www.conf" php_mysql_package: php5-mysql php_memcached_package: php5-memcached From bc7ba214f016a92aeb2b0b99949b27ff3dc7300c Mon Sep 17 00:00:00 2001 From: Jeff Geerling <geerlingguy@mac.com> Date: Tue, 17 May 2016 09:45:21 -0500 Subject: [PATCH 0288/1273] Update PHP 5.6 usage docs for installed_extras. --- docs/other/php-56.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/docs/other/php-56.md b/docs/other/php-56.md index 80112eaa3..4cdb2645d 100644 --- a/docs/other/php-56.md +++ b/docs/other/php-56.md @@ -44,6 +44,20 @@ xhprof_download_folder_name: xhprof-master If you're using Apache with `mod_php` you should also add `libapache2-mod-php5` to the `php_packages` list. +Also, if you're using one of the `installed_extras`, you may need to update the package names accordingly: + +```yaml +# If you install `redis`: +php_redis_package: php5-redis + +# If you install `memcached`: +php_memcached_package: php5-memcached + +# If you install `xhprof`: +xhprof_download_url: https://github.com/phacility/xhprof/archive/master.tar.gz +xhprof_download_folder_name: xhprof-master +``` + ## RedHat/CentOS 7 Remi's RPM repository is included with Drupal VM, and you can make the following changes to use it to install PHP 5.6 instead of 7: From 8faa99714fac2e06ab952aae2b6fd49321396a9c Mon Sep 17 00:00:00 2001 From: Jeff Geerling <geerlingguy@mac.com> Date: Tue, 17 May 2016 09:52:16 -0500 Subject: [PATCH 0289/1273] Update to JJG-Ansible-Windows 2.0.1. --- provisioning/JJG-Ansible-Windows/windows.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/provisioning/JJG-Ansible-Windows/windows.sh b/provisioning/JJG-Ansible-Windows/windows.sh index 1cc2a749a..a96d5169e 100644 --- a/provisioning/JJG-Ansible-Windows/windows.sh +++ b/provisioning/JJG-Ansible-Windows/windows.sh @@ -56,11 +56,11 @@ if ! command -v ansible >/dev/null; then wget https://bootstrap.pypa.io/get-pip.py python get-pip.py && rm -f get-pip.py - # Install GCC / required build tools. + echo "Installing required build tools." if [[ ! -z $YUM ]]; then - yum install -y gcc + yum install -y gcc libffi-devel openssl-devel elif [[ ! -z $APT_GET ]]; then - apt-get install -y build-essential + apt-get install -y build-essential libssl-dev libffi-dev fi echo "Installing required python modules." From d00eebecd3d130028729afbeefda59c40db6e3b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oskar=20Sch=C3=B6ldstr=C3=B6m?= <public@oxy.fi> Date: Tue, 17 May 2016 22:33:01 -0500 Subject: [PATCH 0290/1273] Issue #641: Fix so that optional variables are in fact optional --- provisioning/playbook.yml | 4 ++-- provisioning/tasks/cron.yml | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/provisioning/playbook.yml b/provisioning/playbook.yml index 5eda4be6d..163c63d5f 100644 --- a/provisioning/playbook.yml +++ b/provisioning/playbook.yml @@ -18,7 +18,7 @@ - name: Run configured pre-provision shell scripts. script: "{{ item }}" - with_items: "{{ pre_provision_scripts|default(omit) }}" + with_items: "{{ pre_provision_scripts|default([]) }}" - name: Run configured pre-provision ansible task files. include: "{{ item }}" @@ -97,7 +97,7 @@ - name: Run configured post-provision shell scripts. script: "{{ item }}" - with_items: "{{ post_provision_scripts|default(omit) }}" + with_items: "{{ post_provision_scripts|default([]) }}" - name: Run configured post-provision ansible task files. include: "{{ item }}" diff --git a/provisioning/tasks/cron.yml b/provisioning/tasks/cron.yml index 96f726425..f015cde16 100644 --- a/provisioning/tasks/cron.yml +++ b/provisioning/tasks/cron.yml @@ -9,6 +9,5 @@ month: "{{ item.month | default('*') }}" job: "{{ item.job }}" state: "{{ item.state | default('present') }}" - with_items: "{{ drupalvm_cron_jobs }}" - when: drupalvm_cron_jobs is defined + with_items: "{{ drupalvm_cron_jobs|default([]) }}" become: no From 1efae870f14fa41a84edea6641ecaabdb50f46f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oskar=20Sch=C3=B6ldstr=C3=B6m?= <public@oxy.fi> Date: Wed, 18 May 2016 16:37:04 -0500 Subject: [PATCH 0291/1273] Make config.yml optional by always loading default configurations --- .travis.yml | 6 +++--- Vagrantfile | 15 +++++++-------- example.config.yml => default.config.yml | 0 provisioning/playbook.yml | 6 ++---- tests/{local.config.yml => config.yml} | 0 tests/ubuntu-16-nginx.config.yml | 9 --------- 6 files changed, 12 insertions(+), 24 deletions(-) rename example.config.yml => default.config.yml (100%) rename tests/{local.config.yml => config.yml} (100%) diff --git a/.travis.yml b/.travis.yml index 771c664f3..4fd1c1096 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,7 +3,7 @@ sudo: required env: global: - - CONFIG: example.config.yml + - CONFIG: tests/config.yml MAKEFILE: example.drupal.make.yml HOSTNAME: drupalvm.dev MACHINE_NAME: drupalvm @@ -18,7 +18,7 @@ env: version: 16.04 init: /sbin/init run_opts: "--privileged" - local_config: ubuntu-16-nginx.config.yml + local_config: tests/ubuntu-16-nginx.config.yml config_dir: /var/www/drupalvm/config - distribution: centos version: 7 @@ -59,7 +59,7 @@ script: - 'sudo docker exec "$(cat ${container_id})" cp ${DRUPALVM_DIR}/${MAKEFILE} ${config_dir:-$DRUPALVM_DIR}/drupal.make.yml' # Override configuration variables. - - 'sudo docker exec "$(cat ${container_id})" bash -c "cp ${DRUPALVM_DIR}/tests/${local_config:-local.config.yml} ${config_dir:-$DRUPALVM_DIR}/local.config.yml"' + - '[[ ! -z "${local_config}" ]] && sudo docker exec "$(cat ${container_id})" bash -c "cp ${DRUPALVM_DIR}/${local_config} ${config_dir:-$DRUPALVM_DIR}/local.config.yml" || true' # Vagrantfile syntax check - 'rubocop --except LineLength,Eval,MutableConstant' diff --git a/Vagrantfile b/Vagrantfile index 3873ee00d..769c148c0 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -34,15 +34,14 @@ def walk(obj, &fn) end end -# Use config.yml and local.config.yml for VM configuration. require 'yaml' -unless File.exist?("#{host_config_dir}/config.yml") - raise 'Configuration file not found! Please copy example.config.yml to config.yml and try again.' -end -vconfig = YAML.load_file("#{host_config_dir}/config.yml") -# Include a local.config.yml file if available. -if File.exist?("#{host_config_dir}/local.config.yml") - vconfig.merge!(YAML.load_file("#{host_config_dir}/local.config.yml")) +# Load default VM configurations. +vconfig = YAML.load_file("#{host_drupalvm_dir}/default.config.yml") +# Use optional config.yml and local.config.yml for configuration overrides. +['config.yml', 'local.config.yml'].each do |config_file| + if File.exist?("#{host_config_dir}/#{config_file}") + vconfig.merge!(YAML.load_file("#{host_config_dir}/#{config_file}")) + end end # Replace jinja variables in config. diff --git a/example.config.yml b/default.config.yml similarity index 100% rename from example.config.yml rename to default.config.yml diff --git a/provisioning/playbook.yml b/provisioning/playbook.yml index 296f5d445..453fcc50a 100644 --- a/provisioning/playbook.yml +++ b/provisioning/playbook.yml @@ -4,6 +4,7 @@ vars_files: - vars/main.yml + - ../default.config.yml pre_tasks: - name: Define config_dir. @@ -11,12 +12,9 @@ config_dir: "{{ playbook_dir }}/.." when: config_dir is not defined - - include_vars: "{{ item }}" - with_items: - - "{{ config_dir }}/config.yml" - - include_vars: "{{ item }}" with_fileglob: + - "{{ config_dir }}/config.yml" - "{{ config_dir }}/local.config.yml" - include: tasks/init-debian.yml diff --git a/tests/local.config.yml b/tests/config.yml similarity index 100% rename from tests/local.config.yml rename to tests/config.yml diff --git a/tests/ubuntu-16-nginx.config.yml b/tests/ubuntu-16-nginx.config.yml index 525fedad3..44ee51312 100644 --- a/tests/ubuntu-16-nginx.config.yml +++ b/tests/ubuntu-16-nginx.config.yml @@ -1,11 +1,2 @@ --- -composer_home_path: "/{{ drupalvm_user }}/.composer" drupalvm_webserver: nginx - -installed_extras: - - adminer - - drupalconsole - - mailhog - - pimpmylog - - varnish - - xhprof From 7b85babbf02ba6639bd1245858b53f52b09b4161 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oskar=20Sch=C3=B6ldstr=C3=B6m?= <public@oxy.fi> Date: Wed, 18 May 2016 17:56:59 -0500 Subject: [PATCH 0292/1273] Rename example.config.yml to default.config.yml --- README.md | 6 +++--- docs/deployment/drush-make.md | 2 +- docs/extras/syncing-folders.md | 4 ++-- docs/extras/varnish.md | 2 +- docs/other/base-os.md | 2 +- docs/other/drupalvm-composer-dependency.md | 10 +++++----- docs/other/webservers.md | 4 ++-- examples/acquia/README.md | 4 ++-- examples/prod/README.md | 2 +- 9 files changed, 18 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index bf5abc30f..9f286892a 100644 --- a/README.md +++ b/README.md @@ -69,9 +69,9 @@ Notes: ### 2 - Build the Virtual Machine 1. Download this project and put it wherever you want. - 2. Make copies of both of the `example.*` files, and modify to your liking: + 2. Make copies of both example configuration files, and modify to your liking: - Copy `example.drupal.make.yml` to `drupal.make.yml`. - - Copy `example.config.yml` to `config.yml`. + - Copy `default.config.yml` to `config.yml`. 3. Create a local directory where Drupal will be installed and configure the path to that directory in `config.yml` (`local_path`, inside `vagrant_synced_folders`). 4. Open Terminal, `cd` to this directory (containing the `Vagrantfile` and this README file). 5. Type in `vagrant up`, and let Vagrant do its magic. @@ -117,7 +117,7 @@ Drupal VM is built to integrate with every developer's workflow. Many guides for Drupal VM follows semantic versioning, which means your configuration should continue working (potentially with very minor modifications) throughout a major release cycle. Here is the process to follow when updating Drupal VM between minor releases: 1. Read through the [release notes](https://github.com/geerlingguy/drupal-vm/releases) and add/modify `config.yml` variables mentioned therein. - 2. Do a diff of my config.yml with the updated example.config.yml (e.g. `curl https://raw.githubusercontent.com/geerlingguy/drupal-vm/master/example.config.yml | git diff --no-index config.yml -`). + 2. Do a diff of your `config.yml` with the updated `default.config.yml` (e.g. `curl https://raw.githubusercontent.com/geerlingguy/drupal-vm/master/default.config.yml | git diff --no-index config.yml -`). 3. Run `vagrant provision` to provision the VM, incorporating all the latest changes. For major version upgrades (e.g. 2.x.x to 3.x.x), it may be simpler to destroy the VM (`vagrant destroy`) then build a fresh new VM (`vagrant up`) using the new version of Drupal VM. diff --git a/docs/deployment/drush-make.md b/docs/deployment/drush-make.md index 433fc6808..40d0d50b4 100644 --- a/docs/deployment/drush-make.md +++ b/docs/deployment/drush-make.md @@ -2,4 +2,4 @@ Drupal VM is configured by default to use a Drush make file to build a Drupal si You can use any make file you want, just copy it or symlink it into the root of the Drupal VM folder with the filename `drupal.make.yml`. You can also set a separate path to the makefile using the `drush_makefile_path` variable. -Leave the rest of the settings in `config.yml` as defaults from `example.config.yml`, or tweak the settings as you'd like, then run `vagrant up` as in the Quick Start Guide. Within a few minutes, you should have your site running and available at the `drupal_domain` configured in `config.yml`. \ No newline at end of file +Leave the rest of the settings in `config.yml` as defaults from `default.config.yml`, or tweak the settings as you'd like, then run `vagrant up` as in the Quick Start Guide. Within a few minutes, you should have your site running and available at the `drupal_domain` configured in `config.yml`. diff --git a/docs/extras/syncing-folders.md b/docs/extras/syncing-folders.md index dc0f1fe30..e29b3e6b8 100644 --- a/docs/extras/syncing-folders.md +++ b/docs/extras/syncing-folders.md @@ -1,4 +1,4 @@ -You can share folders between your host computer and the VM in a variety of ways; the most commonly-used method is an NFS share. If you use Windows and encounter any problems with NFS, try switching to `smb`. The `example.config.yml` file contains an example `nfs` share that would sync the folder `~/Sites/drupalvm` on your host into the `/var/www/drupalvm` folder on Drupal VM. +You can share folders between your host computer and the VM in a variety of ways; the most commonly-used method is an NFS share. If you use Windows and encounter any problems with NFS, try switching to `smb`. The `default.config.yml` file contains an example `nfs` share that would sync the folder `~/Sites/drupalvm` on your host into the `/var/www/drupalvm` folder on Drupal VM. If you want to use a different synced folder method (e.g. `smb`), you can change `type` to: @@ -105,4 +105,4 @@ See [this issue](https://github.com/geerlingguy/drupal-vm/issues/66) for more de ### Other NFS-related errors -If you're having other weird issues, and none of the above fixes helps, you might want to try a different synced folder method (see top of this page), or something like File Conveyor or a special rsync setup (see [here](http://wolfgangziegler.net/auto-rsync-local-changes-to-remote-server#comments) for some examples). \ No newline at end of file +If you're having other weird issues, and none of the above fixes helps, you might want to try a different synced folder method (see top of this page), or something like File Conveyor or a special rsync setup (see [here](http://wolfgangziegler.net/auto-rsync-local-changes-to-remote-server#comments) for some examples). diff --git a/docs/extras/varnish.md b/docs/extras/varnish.md index a1b416c71..38b0cf677 100644 --- a/docs/extras/varnish.md +++ b/docs/extras/varnish.md @@ -2,7 +2,7 @@ To enable Varnish, make sure `varnish` is in the list of your `installed_extras` in `config.yml`, and run `vagrant provision`. -There are a few varnish configuration variables further down in `example.config.yml` that you may wish to configure. You can use your own `.vcl` file template (instead of the generic Drupal 7-focused generic one) by editing the `varnish_default_vcl_template_path`, and you can use a different port for Varnish by changing `varnish_listen_port`. +There are a few varnish configuration variables further down in `default.config.yml` that you may wish to configure. You can use your own `.vcl` file template (instead of the generic Drupal 7-focused generic one) by editing the `varnish_default_vcl_template_path`, and you can use a different port for Varnish by changing `varnish_listen_port`. If you'd like to use Varnish on port 80, and switch Apache to a different backend port, you can do so pretty easily; just make sure you have the following values set in your `config.yml` file, and run `vagrant provision` to have Ansible make the necessary changes: diff --git a/docs/other/base-os.md b/docs/other/base-os.md index 89dc935cc..482a1795b 100644 --- a/docs/other/base-os.md +++ b/docs/other/base-os.md @@ -8,7 +8,7 @@ Currently-supported OSes are: - RedHat Enterprise Linux / CentOS 7 - RedHat Enterprise Linux / CentOS 6 -For certain OSes, there are a couple other caveats and tweaks you may need to perform to get things running smoothly—the main features and latest development is only guaranteed to work with the default OS as configured in `example.config.yml`. +For certain OSes, there are a couple other caveats and tweaks you may need to perform to get things running smoothly—the main features and latest development is only guaranteed to work with the default OS as configured in `default.config.yml`. Some other OSes should work, but are not regularly tested with Drupal VM, including Debian 8/Jessie (`debian/jessie64`) and Debian 7/Wheezy (`debian/wheezy64`). diff --git a/docs/other/drupalvm-composer-dependency.md b/docs/other/drupalvm-composer-dependency.md index ae4b305f1..e6d58c64f 100644 --- a/docs/other/drupalvm-composer-dependency.md +++ b/docs/other/drupalvm-composer-dependency.md @@ -29,11 +29,11 @@ _Note: This will be the directory where Drupal VM looks for other local configur └── drupal-vm/ ``` -If you're using `pre_provision_scripts` or `post_provision_scripts` you also need to adjust their paths to take into account the new directory structure. The examples used in `example.config.yml` assume the files are located in the Drupal VM directory. If you use relative paths you need to the ascend the directory tree as far as the project root, but using the `config_dir` variable you get the absolute path of where you `config.yml` is located. +If you're using `pre_provision_scripts` or `post_provision_scripts` you also need to adjust their paths to take into account the new directory structure. The examples used in `default.config.yml` assume the files are located in the Drupal VM directory. If you use relative paths you need to the ascend the directory tree as far as the project root, but using the `config_dir` variable you get the absolute path of where you `config.yml` is located. ```yaml post_provision_scripts: - # The default provided in `example.config.yml`: + # The default provided in `default.config.yml`: - "../../examples/scripts/configure-solr.sh" # With Drupal VM as a Composer dependency: - "{{ config_dir }}/../examples/scripts/configure-solr.sh" @@ -98,7 +98,7 @@ If you don't use `composer` in your project you can still download Drupal VM (o │ └── index.php └── box/ ├── ... - ├── example.config.yml + ├── default.config.yml └── Vagrantfile ``` @@ -106,7 +106,7 @@ Configure your `config.yml` as mentioned in the [`composer` section](#setup-your ```yaml post_provision_scripts: - # The default provided in `example.config.yml`: + # The default provided in `default.config.yml`: - "../../examples/scripts/configure-solr.sh" # With Drupal VM in a toplevel subdirectory - "{{ config_dir }}/../examples/scripts/configure-solr.sh" @@ -126,7 +126,7 @@ Your directory structure should now look like this: │ └── index.php └── box/ ├── ... - ├── example.config.yml + ├── default.config.yml └── Vagrantfile ``` diff --git a/docs/other/webservers.md b/docs/other/webservers.md index 3011c021d..bd2b24245 100644 --- a/docs/other/webservers.md +++ b/docs/other/webservers.md @@ -6,12 +6,12 @@ Because the webservers are configured somewhat differently, there are a few thin ## Using Apache -You have complete control over all aspects of Apache VirtualHosts using the `apache_vhosts` configuration. A few simple examples are shown in `example.config.yml`, but this configuration can be much more complex. +You have complete control over all aspects of Apache VirtualHosts using the `apache_vhosts` configuration. A few simple examples are shown in `default.config.yml`, but this configuration can be much more complex. See the examples included in the [`geerlingguy.apache` Ansible role's README](https://github.com/geerlingguy/ansible-role-apache#readme) for more info, as well as many other variables you can override to configure Apache exactly how you like it. ## Using Nginx -Because Nginx server directives behave a little differently than Apache's VirtualHosts, Drupal VM includes a custom Drupal-optimized Nginx server block configuration, and you can control all the servers ('virtual hosts') Nginx will run using the `nginx_hosts` configuration. A few simple examples are shown in `example.config.yml`, but you have some extra flexibility if you need it. See the `nginx-vhost.conf.j2` template for more information. +Because Nginx server directives behave a little differently than Apache's VirtualHosts, Drupal VM includes a custom Drupal-optimized Nginx server block configuration, and you can control all the servers ('virtual hosts') Nginx will run using the `nginx_hosts` configuration. A few simple examples are shown in `default.config.yml`, but you have some extra flexibility if you need it. See the `nginx-vhost.conf.j2` template for more information. Also, see the examples included in the [`geerlingguy.nginx` Ansible role's README](https://github.com/geerlingguy/ansible-role-nginx#readme) for more info, as well as many other variables you can override to configure Nginx exactly how you like it. diff --git a/examples/acquia/README.md b/examples/acquia/README.md index 74f546dd8..159563278 100644 --- a/examples/acquia/README.md +++ b/examples/acquia/README.md @@ -1,6 +1,6 @@ # Acquia Cloud Drupal VM Configuration Example -This directory contains example configuration changes for the default Drupal VM `example.config.yml` file which emulate the default Acquia Cloud environment with Drupal VM: +This directory contains example configuration changes for the default Drupal VM `default.config.yml` file which emulate the default Acquia Cloud environment with Drupal VM: - Ubuntu 12.04.5 LTS - Apache 2.2.22 @@ -8,4 +8,4 @@ This directory contains example configuration changes for the default Drupal VM - MySQL/Percona 5.5.24 - Apache Solr 4.5.1 -To use these overrides, copy `example.config.yml` to `config.yml` as you would normally, but make sure the variables defined in `acquia.overrides.yml` are defined with the same values in your `config.yml` file. +To use these overrides, copy `default.config.yml` to `config.yml` as you would normally, but make sure the variables defined in `acquia.overrides.yml` are defined with the same values in your `config.yml` file. diff --git a/examples/prod/README.md b/examples/prod/README.md index be0664bbd..2f0221a57 100644 --- a/examples/prod/README.md +++ b/examples/prod/README.md @@ -33,7 +33,7 @@ Your DigitalOcean Droplet is booted and ready to have Drupal VM installed on it. ## Customize `config.yml` and `inventory` for production -Just like you would with the normal `example.config.yml`, you need to copy the file to `config.yml`, then go through `prod.overrides.yml` (in this directory), and make sure to update your `config.yml`, making sure all the variables are set to match `prod.overrides.yml`. +Just like you would with the normal `default.config.yml`, you need to copy the file to `config.yml`, then go through `prod.overrides.yml` (in this directory), and make sure to update your `config.yml`, making sure all the variables are set to match `prod.overrides.yml`. The changes outlined in `prod.overrides.yml` disable development-environment tools (like Pimp My Log and Adminer) and add extra security hardening configuration (via the `extra_security_enabled` variable). From 82b932ecdf3e7363f1894d13740384efa9800f34 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oskar=20Sch=C3=B6ldstr=C3=B6m?= <public@oxy.fi> Date: Wed, 18 May 2016 18:42:48 -0500 Subject: [PATCH 0293/1273] Update docs taking into account default.config.yml [ci skip] --- docs/deployment/drush-make.md | 2 +- examples/acquia/README.md | 4 +-- examples/acquia/acquia.config.yml | 32 +++++++++++++++++++ examples/acquia/acquia.overrides.yml | 4 --- examples/prod/README.md | 8 ++--- .../{prod.overrides.yml => prod.config.yml} | 4 +-- 6 files changed, 41 insertions(+), 13 deletions(-) create mode 100644 examples/acquia/acquia.config.yml delete mode 100644 examples/acquia/acquia.overrides.yml rename examples/prod/{prod.overrides.yml => prod.config.yml} (89%) diff --git a/docs/deployment/drush-make.md b/docs/deployment/drush-make.md index 40d0d50b4..8ce4e93a1 100644 --- a/docs/deployment/drush-make.md +++ b/docs/deployment/drush-make.md @@ -2,4 +2,4 @@ Drupal VM is configured by default to use a Drush make file to build a Drupal si You can use any make file you want, just copy it or symlink it into the root of the Drupal VM folder with the filename `drupal.make.yml`. You can also set a separate path to the makefile using the `drush_makefile_path` variable. -Leave the rest of the settings in `config.yml` as defaults from `default.config.yml`, or tweak the settings as you'd like, then run `vagrant up` as in the Quick Start Guide. Within a few minutes, you should have your site running and available at the `drupal_domain` configured in `config.yml`. +Have a look at the defaults in `default.config.yml` and tweak the settings as you'd like in your `config.yml`, then run `vagrant up` as in the Quick Start Guide. Within a few minutes, you should have your site running and available at the `drupal_domain` configured in `config.yml`, falling back to the default `http://drupalvm.dev` set in `default.config.yml`. diff --git a/examples/acquia/README.md b/examples/acquia/README.md index 159563278..9d4244ae9 100644 --- a/examples/acquia/README.md +++ b/examples/acquia/README.md @@ -1,6 +1,6 @@ # Acquia Cloud Drupal VM Configuration Example -This directory contains example configuration changes for the default Drupal VM `default.config.yml` file which emulate the default Acquia Cloud environment with Drupal VM: +This directory contains example configuration overrides for the default Drupal VM `default.config.yml` file which emulate the default Acquia Cloud environment with Drupal VM: - Ubuntu 12.04.5 LTS - Apache 2.2.22 @@ -8,4 +8,4 @@ This directory contains example configuration changes for the default Drupal VM - MySQL/Percona 5.5.24 - Apache Solr 4.5.1 -To use these overrides, copy `default.config.yml` to `config.yml` as you would normally, but make sure the variables defined in `acquia.overrides.yml` are defined with the same values in your `config.yml` file. +To use these overrides, copy `acquia.config.yml` to `config.yml`, and by looking at `default.config.yml` add any other overrides you'd like. Whatever variables you have set in `config.yml` will override the defaults set by `default.config.yml`. diff --git a/examples/acquia/acquia.config.yml b/examples/acquia/acquia.config.yml new file mode 100644 index 000000000..90ab4533a --- /dev/null +++ b/examples/acquia/acquia.config.yml @@ -0,0 +1,32 @@ +--- +vagrant_box: geerlingguy/ubuntu1204 +solr_version: "4.5.1" + +php_version: "5.6" +php_packages: + - php5 + - php5-mcrypt + - php5-cli + - php5-common + - php5-curl + - php5-dev + - php5-fpm + - php5-gd + - php5-sqlite + - php-pear + - libpcre3-dev +php_conf_paths: + - /etc/php5/fpm + - /etc/php5/apache2 + - /etc/php5/cli +php_extension_conf_paths: + - /etc/php5/fpm/conf.d + - /etc/php5/apache2/conf.d + - /etc/php5/cli/conf.d +php_fpm_daemon: php5-fpm +php_fpm_conf_path: "/etc/php5/fpm" +php_fpm_pool_conf_path: "/etc/php5/fpm/pool.d/www.conf" +php_mysql_package: php5-mysql + +installed_extras: + - solr diff --git a/examples/acquia/acquia.overrides.yml b/examples/acquia/acquia.overrides.yml deleted file mode 100644 index bcc7cdb85..000000000 --- a/examples/acquia/acquia.overrides.yml +++ /dev/null @@ -1,4 +0,0 @@ ---- -vagrant_box: geerlingguy/ubuntu1204 -php_version: "5.6" -solr_version: "4.5.1" diff --git a/examples/prod/README.md b/examples/prod/README.md index 2f0221a57..a159a2927 100644 --- a/examples/prod/README.md +++ b/examples/prod/README.md @@ -14,7 +14,7 @@ Make sure you have an SSH key you can use to connect to your DigitalOcean drople Once you are logged into DigitalOcean and have added your SSH key, click the 'Create Droplet' button on your Droplets page. For the Droplet, choose the following options: - - **Image**: Choose `Ubuntu 14.04.x x64` + - **Image**: Choose `Ubuntu 16.04.x x64` - **Size**: 1 GB / 1 CPU (currently $10/month; you can choose a higher plan if needed) - **Region**: Choose whatever region is geographically nearest to you and your site visitors - **Settings**: (Nothing here affects how Drupal VM works, choose what you'd like) @@ -33,9 +33,9 @@ Your DigitalOcean Droplet is booted and ready to have Drupal VM installed on it. ## Customize `config.yml` and `inventory` for production -Just like you would with the normal `default.config.yml`, you need to copy the file to `config.yml`, then go through `prod.overrides.yml` (in this directory), and make sure to update your `config.yml`, making sure all the variables are set to match `prod.overrides.yml`. +Copy `prod.config.yml` to `config.yml`, and by looking at `default.config.yml` add any other overrides you'd like. Whatever variables you have set in `config.yml` will override the defaults set by `default.config.yml`. -The changes outlined in `prod.overrides.yml` disable development-environment tools (like Pimp My Log and Adminer) and add extra security hardening configuration (via the `extra_security_enabled` variable). +The changes outlined in `prod.config.yml` disable development-environment tools (like Pimp My Log and Adminer) and add extra security hardening configuration (via the `extra_security_enabled` variable). The only other thing you need to do is copy the inventory file `example.inventory` to `inventory` (so it is located at `prod/inventory`). By default, it reads: @@ -84,6 +84,6 @@ After a few minutes, your Drupal-VM-in-the-cloud Droplet should be fully configu ## Go Further -You can use Ubuntu 12.04, Ubuntu 14.04, CentOS 6 or CentOS 7 when you build the DigitalOcean Droplet. Just like with Drupal VM running locally, you can customize almost every aspect of the server! +You can use Ubuntu 12.04, Ubuntu 14.04, Ubuntu 16.04, CentOS 6 or CentOS 7 when you build the DigitalOcean Droplet. Just like with Drupal VM running locally, you can customize almost every aspect of the server! You may want to customize your configuration even further, to make sure Drupal VM is tuned for your specific Drupal site's needs, or you may want to change things and make the server configuration more flexible, etc. For all that, the book [Ansible for DevOps](http://ansiblefordevops.com/) will give you a great introduction to using Ansible to make Drupal VM and the included Ansible configuration do exactly what you need! diff --git a/examples/prod/prod.overrides.yml b/examples/prod/prod.config.yml similarity index 89% rename from examples/prod/prod.overrides.yml rename to examples/prod/prod.config.yml index 29b416a36..6018785ef 100644 --- a/examples/prod/prod.overrides.yml +++ b/examples/prod/prod.config.yml @@ -2,8 +2,8 @@ # Normally, this would be set to the hostname of your DigitalOcean Droplet. drupal_domain: "drupalvm.dev" -# Delete all the `apache_vhosts` or `nginx_hosts` you don't need. If only -# installing a single Drupal site, the variable should look like this (Apache): +# Add only the `apache_vhosts` or `nginx_hosts` you need. If installing a +# single Drupal site, the variable should look like this (Apache): apache_vhosts: - servername: "{{ drupal_domain }}" documentroot: "{{ drupal_core_path }}" From 4b7a2d4d7f84024ac14d10abacb5629ec6676664 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oskar=20Sch=C3=B6ldstr=C3=B6m?= <public@oxy.fi> Date: Wed, 18 May 2016 18:43:10 -0500 Subject: [PATCH 0294/1273] Remove duplicate PHP variables in php 5.6 docs [ci skip] --- docs/other/php-56.md | 4 ---- 1 file changed, 4 deletions(-) diff --git a/docs/other/php-56.md b/docs/other/php-56.md index 4cdb2645d..1a4394d9a 100644 --- a/docs/other/php-56.md +++ b/docs/other/php-56.md @@ -36,10 +36,6 @@ php_fpm_daemon: php5-fpm php_fpm_conf_path: "/etc/php5/fpm" php_fpm_pool_conf_path: "/etc/php5/fpm/pool.d/www.conf" php_mysql_package: php5-mysql -php_memcached_package: php5-memcached - -xhprof_download_url: https://github.com/phacility/xhprof/archive/master.tar.gz -xhprof_download_folder_name: xhprof-master ``` If you're using Apache with `mod_php` you should also add `libapache2-mod-php5` to the `php_packages` list. From 16c2de1891f98a4da67182b7eed9c64668281df6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oskar=20Sch=C3=B6ldstr=C3=B6m?= <public@oxy.fi> Date: Wed, 18 May 2016 19:00:14 -0500 Subject: [PATCH 0295/1273] Add docs on config.yml being optional [ci skip] --- docs/other/overriding-configurations.md | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/docs/other/overriding-configurations.md b/docs/other/overriding-configurations.md index 118a65008..12dfbaf72 100644 --- a/docs/other/overriding-configurations.md +++ b/docs/other/overriding-configurations.md @@ -1,4 +1,14 @@ -## Overriding variables in `config.yml` with a `local.config.yml` +## Overriding Drupal VM's `default.config.yml` with `config.yml` + +If available, Drupal VM will load a `config.yml` where you can override any of the defaults set in `default.config.yml`. Commonly this is a copy of `default.config.yml` with the values tweaked to your own project. For an easier upgrade path you would only set the values you are actually overriding. + +```yaml +vagrant_box: geerlingguy/centos7 +vagrant_hostname: my-custom-site.dev +vagrant_machine_name: my_custom_site +``` + +## Overriding variables with a `local.config.yml` If available, Drupal VM will also load a `local.config.yml` after having loaded the main `config.yml`. Using this file you can override variables previously defined in `config.yml`. For teams who are sharing a VM configuration, this is a good place to configure anything that's specific to your own environment. From 9053c102a6060690a9ecf052d49e35cd8bafba71 Mon Sep 17 00:00:00 2001 From: Jeff Geerling <geerlingguy@mac.com> Date: Thu, 19 May 2016 11:08:14 -0500 Subject: [PATCH 0296/1273] Issue #619: Fix OPcache CLI error by using new PHP version. --- provisioning/requirements.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/provisioning/requirements.yml b/provisioning/requirements.yml index c232939ca..1ae96f135 100644 --- a/provisioning/requirements.yml +++ b/provisioning/requirements.yml @@ -36,7 +36,7 @@ - src: geerlingguy.nodejs version: 3.0.0 - src: geerlingguy.php - version: 3.0.3 + version: 3.0.4 - src: geerlingguy.php-memcached version: 2.0.0 - src: geerlingguy.php-mysql From 78677683d302027ca7c5b4f605a8bf0ef50b5ea0 Mon Sep 17 00:00:00 2001 From: Jeff Geerling <geerlingguy@mac.com> Date: Thu, 19 May 2016 11:13:59 -0500 Subject: [PATCH 0297/1273] Update Varnish role version. --- provisioning/requirements.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/provisioning/requirements.yml b/provisioning/requirements.yml index 1ae96f135..485c7fd50 100644 --- a/provisioning/requirements.yml +++ b/provisioning/requirements.yml @@ -64,4 +64,4 @@ - src: geerlingguy.solr version: 2.1.0 - src: geerlingguy.varnish - version: 1.5.0 + version: 1.6.0 From f8899949522afc16670c9ed4259df4aafb93fcff Mon Sep 17 00:00:00 2001 From: Joe Stewart <joe.stewart@mediacurrent.com> Date: Fri, 20 May 2016 17:01:03 -0500 Subject: [PATCH 0298/1273] Docs: Install php5-apcu. [ci skip] --- docs/other/php-56.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/other/php-56.md b/docs/other/php-56.md index 4cdb2645d..4df5b353c 100644 --- a/docs/other/php-56.md +++ b/docs/other/php-56.md @@ -14,6 +14,7 @@ Ondřej Surý's PPA for PHP 7.0 is used to install PHP 7, but you can switch to php_version: "5.6" php_packages: - php5 + - php5-apcu - php5-mcrypt - php5-cli - php5-common From 856e8d704e42859a87806ff4d8c6a9313dcc1ede Mon Sep 17 00:00:00 2001 From: Dan Bohea <git@bohea.co.uk> Date: Wed, 25 May 2016 09:17:43 +0100 Subject: [PATCH 0299/1273] Setting configure_local_drush_aliases to false now behaves as expected. - Fixes #662 --- provisioning/tasks/drush-aliases.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/provisioning/tasks/drush-aliases.yml b/provisioning/tasks/drush-aliases.yml index 86a5145f3..a9d85a62a 100644 --- a/provisioning/tasks/drush-aliases.yml +++ b/provisioning/tasks/drush-aliases.yml @@ -33,6 +33,7 @@ src: ../templates/drupalvm-local.aliases.drushrc.php.j2 dest: "~/.drush/{{ vagrant_machine_name }}.aliases.drushrc.php" become: no + when: configure_local_drush_aliases - name: Ensure drush directory exists for root user inside VM. file: 'path="~/.drush" state=directory' @@ -41,3 +42,4 @@ template: src: ../templates/drupalvm-local.aliases.drushrc.php.j2 dest: "~/.drush/{{ vagrant_machine_name }}.aliases.drushrc.php" + when: configure_local_drush_aliases From 9a079dd97eef03128e0b6f631f0177cfff5108ac Mon Sep 17 00:00:00 2001 From: Richard Robinson <richardrobinsonx@users.noreply.github.com> Date: Sun, 29 May 2016 22:39:52 -0500 Subject: [PATCH 0300/1273] Update drush.md Apparently Ansible is required to make this happen and it doesn't mention it in the documentation. --- docs/extras/drush.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/extras/drush.md b/docs/extras/drush.md index 9aabd7cb7..de68518a9 100644 --- a/docs/extras/drush.md +++ b/docs/extras/drush.md @@ -1,4 +1,4 @@ -If you have Drush installed on your host workstation, and would like to interact with a Drupal site running inside Drupal VM, there are drush aliases automatically created by Drupal VM for each of the virtual hosts you have configured. +If you have Drush and Ansible installed on your host workstation, and would like to interact with a Drupal site running inside Drupal VM, there are drush aliases automatically created by Drupal VM for each of the virtual hosts you have configured. With the example configuration, you can manage the example Drupal site using the Drush alias `@drupalvm.dev`. For example, to check if Drush can connect to the site in Drupal VM, run: From cd51252f700082d845211c45351a4cc2d1ed69a6 Mon Sep 17 00:00:00 2001 From: Jeff Geerling <geerlingguy@mac.com> Date: Tue, 31 May 2016 23:21:47 -0500 Subject: [PATCH 0301/1273] Fixes #654: Remove ansible.cfg because role install is handled by Vagrant. --- ansible.cfg | 2 -- 1 file changed, 2 deletions(-) delete mode 100644 ansible.cfg diff --git a/ansible.cfg b/ansible.cfg deleted file mode 100644 index 002a50dd5..000000000 --- a/ansible.cfg +++ /dev/null @@ -1,2 +0,0 @@ -[defaults] -roles_path = ./roles From 1dfc78dcf60c4834559f2ba54039146e6149213c Mon Sep 17 00:00:00 2001 From: Jeff Geerling <geerlingguy@mac.com> Date: Tue, 31 May 2016 23:35:07 -0500 Subject: [PATCH 0302/1273] Update README to add a link explaining config overrides. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 9f286892a..d0b684e46 100644 --- a/README.md +++ b/README.md @@ -42,7 +42,7 @@ Full Drupal VM documentation is available at http://docs.drupalvm.com/ There are a couple places where you can customize the VM for your needs: - - `config.yml`: Contains variables like the VM domain name and IP address, PHP and MySQL configuration, etc. + - `config.yml`: Override any of the default VM configuration from `default.config.yml`; customize almost any aspect of any software installed in the VM (more about [overriding configurations](http://docs.drupalvm.com/en/latest/other/overriding-configurations/). - `drupal.make.yml`: Contains configuration for the Drupal core version, modules, and patches that will be downloaded on Drupal's initial installation (more about [Drush make files](https://www.drupal.org/node/1432374)). If you want to switch from Drupal 8 (default) to Drupal 7 on the initial install, do the following: From cdbb0a139d6416ab63187d8fe7db0534f677f771 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oskar=20Sch=C3=B6ldstr=C3=B6m?= <public@oxy.fi> Date: Wed, 1 Jun 2016 18:55:35 -0400 Subject: [PATCH 0303/1273] Issue #683: Change the default synced directory to drupal vm's own directory --- default.config.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/default.config.yml b/default.config.yml index 9e5255fa1..99d298328 100644 --- a/default.config.yml +++ b/default.config.yml @@ -21,8 +21,8 @@ vagrant_public_ip: "" # http://docs.drupalvm.com/en/latest/extras/syncing-folders/ for more info. vagrant_synced_folders: # The first synced folder will be used for the default Drupal installation, if - # build_makefile: is 'true'. - - local_path: ~/Sites/drupalvm + # build_makefile: is 'true'. By default it's set to the drupal-vm folder. + - local_path: . destination: /var/www/drupalvm type: nfs create: true From 347817639b86311977109405dd9105841faab560 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oskar=20Sch=C3=B6ldstr=C3=B6m?= <public@oxy.fi> Date: Wed, 1 Jun 2016 19:06:14 -0400 Subject: [PATCH 0304/1273] Issue #683: Update docs with the new default synced folder path. --- docs/extras/behat.md | 2 +- docs/extras/syncing-folders.md | 10 +++++----- docs/other/overriding-configurations.md | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/docs/extras/behat.md b/docs/extras/behat.md index 40a39018d..904548a2d 100644 --- a/docs/extras/behat.md +++ b/docs/extras/behat.md @@ -27,7 +27,7 @@ _You can also include `drupal/drupal-extension` directly in your project's `comp ## Setting up Behat for your project -Using the default Drupal site as an example (it's installed in `/var/www/drupalvm/drupal` by default, and is shared to `~/Sites/drupalvm/drupal` on your host machine), the following steps will help you get your first Behat tests up and running! +Using the default Drupal site as an example (it's installed in `/var/www/drupalvm/drupal` by default, and is shared to the `./drupal` folder inside the drupal-vm directory on your host machine), the following steps will help you get your first Behat tests up and running! 1. Create a `behat.yml` file inside the docroot of your site (e.g. create this file alongside the rest of the Drupal codebase at `/var/www/drupalvm/drupal/behat.yml`), with the following contents: diff --git a/docs/extras/syncing-folders.md b/docs/extras/syncing-folders.md index e29b3e6b8..37a11c011 100644 --- a/docs/extras/syncing-folders.md +++ b/docs/extras/syncing-folders.md @@ -1,10 +1,10 @@ -You can share folders between your host computer and the VM in a variety of ways; the most commonly-used method is an NFS share. If you use Windows and encounter any problems with NFS, try switching to `smb`. The `default.config.yml` file contains an example `nfs` share that would sync the folder `~/Sites/drupalvm` on your host into the `/var/www/drupalvm` folder on Drupal VM. +You can share folders between your host computer and the VM in a variety of ways; the most commonly-used method is an NFS share. If you use Windows and encounter any problems with NFS, try switching to `smb`. The `default.config.yml` file contains an example `nfs` share that would sync the entire drupal-vm directory (configured as the relative path `.`) on your host into the `/var/www/drupalvm` folder on Virtual Machine. If you want to use a different synced folder method (e.g. `smb`), you can change `type` to: ```yaml vagrant_synced_folders: - - local_path: ~/Sites/drupalvm + - local_path: . destination: /var/www/drupalvm type: smb create: true @@ -54,7 +54,7 @@ If you are using rsync, it is advised to exclude certain directories so that the ```yaml vagrant_synced_folders: - - local_path: ~/Sites/drupalvm + - local_path: . destination: /var/www/drupalvm type: rsync create: true @@ -73,11 +73,11 @@ There are a number of issues people encounter with synced folders from time to t ### Using Native Synced Folders -You can use a native synced folder, which should work pretty flawlessly on any platform, but with a potential serious performance downside (compared to other synced folder methods). Just set `type` to `""`, and you can even put the synced folder inside the drupal-vm folder using a relative path, like: +You can use a native synced folder, which should work pretty flawlessly on any platform, but with a potential serious performance downside (compared to other synced folder methods). Just set `type` to `""`. ```yaml vagrant_synced_folders: - - local_path: docroot + - local_path: . destination: /var/www/docroot type: "" create: true diff --git a/docs/other/overriding-configurations.md b/docs/other/overriding-configurations.md index 12dfbaf72..43f698720 100644 --- a/docs/other/overriding-configurations.md +++ b/docs/other/overriding-configurations.md @@ -19,7 +19,7 @@ php_memory_limit: "512M" # Override the synced folders to use rsync instead of NFS. vagrant_synced_folders: - - local_path: ~/Sites/drupalvm + - local_path: . destination: /var/www/drupalvm type: rsync create: true From 8d7104d3c10a11fa3b76844c4f68f110059c09f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oskar=20Sch=C3=B6ldstr=C3=B6m?= <public@oxy.fi> Date: Wed, 1 Jun 2016 19:31:17 -0400 Subject: [PATCH 0305/1273] Issue #666: Add docs on how to run custom playbooks [ci skip] --- docs/extras/scripts.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/docs/extras/scripts.md b/docs/extras/scripts.md index 00948a970..ea2f4699f 100644 --- a/docs/extras/scripts.md +++ b/docs/extras/scripts.md @@ -33,3 +33,19 @@ The path will be evaluated as a [glob pattern](https://docs.python.org/2/library The files matched will run in alphabetical order, and as with shell scripts, pre-provision task files will run before any other packages are installed. _Note: Unlike pre- and post-provision scripts, extra task files will be relative to `provisioning/files/` instead of `provisioning/`._ + + +## Ansible playbooks + +Out of the box Drupal VM does not support running additional playbooks or adding your own roles but using [`Vagrantfile.local`](../other/overriding-configurations.md#extending-the-vagrantfile-with-vagrantfilelocal) you can add any number of additional provisioners to vagrant. + +As an example you might have a `local.playbook.yml` with it's own dependencies defined in `local.requirements.yml`. Place both of these next to your `config.yml` and add the following `Vagrantfile.local`. + +```rb +config.vm.provision 'ansible' do |ansible| + ansible.playbook = "#{host_config_dir}/local.playbook.yml" + ansible.galaxy_role_file = "#{host_config_dir}/local.requirements.yml" +end +``` + +When you run `vagrant provision` this playbook will run after Drupal VM's own playbook. From 9edb853377b68bef558fe3c52a7eb35072d56509 Mon Sep 17 00:00:00 2001 From: Jeff Geerling <geerlingguy@mac.com> Date: Thu, 2 Jun 2016 15:40:24 -0500 Subject: [PATCH 0306/1273] Issue #668: Default to Solr 5.x. --- default.config.yml | 2 +- examples/acquia/acquia.config.yml | 5 ++++- provisioning/requirements.yml | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/default.config.yml b/default.config.yml index 9e5255fa1..8e2a15bde 100644 --- a/default.config.yml +++ b/default.config.yml @@ -261,7 +261,7 @@ php_xdebug_idekey: PHPSTORM php_xdebug_max_nesting_level: 256 # Solr Configuration (if enabled above). -solr_version: "4.10.4" +solr_version: "5.5.1" solr_xms: "64M" solr_xmx: "128M" diff --git a/examples/acquia/acquia.config.yml b/examples/acquia/acquia.config.yml index 90ab4533a..d20c09df3 100644 --- a/examples/acquia/acquia.config.yml +++ b/examples/acquia/acquia.config.yml @@ -1,7 +1,8 @@ --- +# Acquia Cloud uses Ubuntu 12.04 LTS. vagrant_box: geerlingguy/ubuntu1204 -solr_version: "4.5.1" +# Acquia Cloud defaults to PHP 5.6. php_version: "5.6" php_packages: - php5 @@ -28,5 +29,7 @@ php_fpm_conf_path: "/etc/php5/fpm" php_fpm_pool_conf_path: "/etc/php5/fpm/pool.d/www.conf" php_mysql_package: php5-mysql +# Acquia Cloud Search defaults to Solr 4.x. +solr_version: "4.5.1" installed_extras: - solr diff --git a/provisioning/requirements.yml b/provisioning/requirements.yml index 485c7fd50..8def01576 100644 --- a/provisioning/requirements.yml +++ b/provisioning/requirements.yml @@ -62,6 +62,6 @@ - src: geerlingguy.security version: 1.2.0 - src: geerlingguy.solr - version: 2.1.0 + version: 3.1.0 - src: geerlingguy.varnish version: 1.6.0 From a1bf8a405d0e422c0e6d5545a431dbb6f7c2bb28 Mon Sep 17 00:00:00 2001 From: Jeff Geerling <geerlingguy@mac.com> Date: Thu, 2 Jun 2016 22:09:30 -0500 Subject: [PATCH 0307/1273] Fixes #668: Update configure-solr script for Solr 5.x. --- examples/scripts/configure-solr.sh | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/examples/scripts/configure-solr.sh b/examples/scripts/configure-solr.sh index 77ca87c52..df659e8b2 100755 --- a/examples/scripts/configure-solr.sh +++ b/examples/scripts/configure-solr.sh @@ -10,9 +10,11 @@ SOLR_SETUP_COMPLETE_FILE=/etc/drupal_vm_solr_config_complete # Search API Solr module. -SOLR_DOWNLOAD=http://ftp.drupal.org/files/projects/search_api_solr-8.x-1.x-dev.tar.gz -SOLR_DOWNLOAD_DIR=/tmp -SOLR_MODULE_NAME=search_api_solr +SOLR_DOWNLOAD="http://ftp.drupal.org/files/projects/search_api_solr-8.x-1.x-dev.tar.gz" +SOLR_DOWNLOAD_DIR="/tmp" +SOLR_MODULE_NAME="search_api_solr" +SOLR_VERSION="5.x" +SOLR_CORE_PATH="/var/solr/data/collection1" # Check to see if we've already performed this setup. if [ ! -e "$SOLR_SETUP_COMPLETE_FILE" ]; then @@ -20,13 +22,13 @@ if [ ! -e "$SOLR_SETUP_COMPLETE_FILE" ]; then wget -qO- $SOLR_DOWNLOAD | tar xvz -C $SOLR_DOWNLOAD_DIR # Copy the Solr configuration into place over the default `collection1` core. - sudo cp -a $SOLR_DOWNLOAD_DIR/$SOLR_MODULE_NAME/solr-conf/4.x/. /var/solr/collection1/conf/ + sudo cp -a $SOLR_DOWNLOAD_DIR/$SOLR_MODULE_NAME/solr-conf/$SOLR_VERSION/. $SOLR_CORE_PATH/conf/ # Adjust the autoCommit time so index changes are committed in 1s. - sudo sed -i 's/\(<maxTime>\)\([^<]*\)\(<[^>]*\)/\11000\3/g' /var/solr/collection1/conf/solrconfig.xml + sudo sed -i 's/\(<maxTime>\)\([^<]*\)\(<[^>]*\)/\11000\3/g' $SOLR_CORE_PATH/conf/solrconfig.xml # Fix file permissions. - sudo chown -R solr:solr /var/solr/collection1/conf + sudo chown -R solr:solr $SOLR_CORE_PATH/conf # Restart Apache Solr. sudo service solr restart From 0f1f1303d6692e8c57dfb16f3b437d68a850ca52 Mon Sep 17 00:00:00 2001 From: Jeff Geerling <geerlingguy@mac.com> Date: Thu, 2 Jun 2016 22:16:48 -0500 Subject: [PATCH 0308/1273] Fixes #651: Document Acquia's BLT project. --- docs/other/management-tools.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/other/management-tools.md b/docs/other/management-tools.md index 14e7d5c4d..e87195ef0 100644 --- a/docs/other/management-tools.md +++ b/docs/other/management-tools.md @@ -6,6 +6,10 @@ If you know of any other tools to help manage Drupal VM, please add them to this [Lunchbox](https://github.com/LunchboxDevTools/lunchbox) is a wrapper for the Drupal VM project to manage your Drupal development process. It is a Node.js-based GUI to assist in setting up Drupal VM and creating and managing instances. +## Acquia BLT + +[BLT (Build and Launch Tool)](https://github.com/acquia/blt) is a project from Acquia that builds a Drupal project repository, and can optionally include Drupal VM as part of the project. There is an open PR that may [use Composer to add Drupal VM as a project dependency automatically](https://github.com/acquia/blt/pull/93). + ## Drupal VM Config Generator [Drupal VM Config Generator](https://github.com/opdavies/drupal-vm-config-generator) is a Symfony Console application that manages and customises configuration files for Drupal VM projects. From 5aaed59a8ae372b62566ec58310ec770122cce96 Mon Sep 17 00:00:00 2001 From: Jeff Geerling <geerlingguy@mac.com> Date: Thu, 2 Jun 2016 23:08:55 -0500 Subject: [PATCH 0309/1273] Ignore generated Drupal project directory. --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index ee6483792..c0f8665af 100644 --- a/.gitignore +++ b/.gitignore @@ -13,3 +13,4 @@ examples/prod/inventory examples/prod/bootstrap/vars.yml scripts/ roles/ +drupal/ From f76446f350ae466dc57ece9ab1ca6040a0f2c109 Mon Sep 17 00:00:00 2001 From: Jeff Geerling <geerlingguy@mac.com> Date: Thu, 2 Jun 2016 23:09:27 -0500 Subject: [PATCH 0310/1273] Fixes #642: Add PHP information to the dashboard. --- default.config.yml | 3 ++ provisioning/tasks/dashboard.yml | 9 +++++- provisioning/templates/dashboard.html.j2 | 36 ++++++++++++++++++++++- provisioning/templates/server-info.php.j2 | 1 + 4 files changed, 47 insertions(+), 2 deletions(-) create mode 100644 provisioning/templates/server-info.php.j2 diff --git a/default.config.yml b/default.config.yml index 9be98cf75..6f433612e 100644 --- a/default.config.yml +++ b/default.config.yml @@ -100,6 +100,9 @@ apache_vhosts: - servername: "{{ vagrant_ip }}" serveralias: "dashboard.{{ vagrant_hostname }}" documentroot: "{{ dashboard_install_dir }}" + extra_parameters: | + ProxyPassMatch ^/(.*\.php(/.*)?)$ "fcgi://127.0.0.1:9000{{ dashboard_install_dir }}" + DirectoryIndex index.html apache_remove_default_vhost: true apache_mods_enabled: diff --git a/provisioning/tasks/dashboard.yml b/provisioning/tasks/dashboard.yml index 4be3504f0..164b07aa8 100644 --- a/provisioning/tasks/dashboard.yml +++ b/provisioning/tasks/dashboard.yml @@ -1,4 +1,5 @@ -- name: Ensure the dashboard directory exists +--- +- name: Ensure the dashboard directory exists. file: path: "{{ dashboard_install_dir }}" state: directory @@ -9,3 +10,9 @@ src: ../templates/dashboard.html.j2 dest: "{{ dashboard_install_dir }}/index.html" mode: 0644 + +- name: Copy phpinfo file into place. + copy: + src: ../templates/server-info.php.j2 + dest: "{{ dashboard_install_dir }}/server-info.php" + mode: 0644 diff --git a/provisioning/templates/dashboard.html.j2 b/provisioning/templates/dashboard.html.j2 index 194895896..237ffab74 100644 --- a/provisioning/templates/dashboard.html.j2 +++ b/provisioning/templates/dashboard.html.j2 @@ -104,13 +104,18 @@ {{ printSite(host.server_name, host.root) }} {%- endfor -%} {%- endif %} - <tr><td colspan=3><small>*Note: On Windows or when you don't have Ansible installed on your host, Drush aliases are only created inside the VM.</small></td></tr> + <tr><td colspan=3><small>*Note: If Ansible isn't installed installed on your host, Drush aliases are only created inside the VM.</small></td></tr> </tbody> </table> {%- endmacro -%} {%- macro sectionDevelopmentTools() -%} <table class="table"> + {% if not installed_extras -%} + <tr> + <td>There are no development tools installed inside the VM.</td> + </tr> + {%- endif -%} {% if 'adminer' in installed_extras -%} {% macro servername() %}{{ getServernameFromDocroot(adminer_install_dir) }}/{{ adminer_install_filename }}{% endmacro %} {%- if servername() != "/{{ adminer_install_filename }}" -%} @@ -177,6 +182,28 @@ </table> {%- endmacro -%} + {%- macro sectionPhpInformation() -%} + <table class="table"> + <tr> + <th>PHP Version</th> + <td><code>{{ php_version }}</code></td> + </tr> + <tr> + <th>Webserver</th> + <td><code>{{ drupalvm_webserver|capitalize }}</code></td> + </tr> + <tr> + <th>Memory limit</th> + <td><code>{{ php_memory_limit }}</code></td> + </tr> + <tr> + <th>PHP-FPM enabled</th> + <td><code>{{ 'yes' if php_enable_php_fpm else 'no' }}</code></td> + </tr> + <tr><td colspan=2><small><a href="/server-info.php">View more details in the server's phpinfo() report</a>.</small></td></tr> + </table> + {%- endmacro -%} + {%- macro sectionDatabaseConnection() -%} <table class="table"> <tr> @@ -294,6 +321,13 @@ {{ sectionDevelopmentTools() }} </div> </section> + + <section class="panel panel-default"> + <div class="panel-heading">PHP information</div> + <div class="panel-body"> + {{ sectionPhpInformation() }} + </div> + </section> </div> <div class="col-md-5"> diff --git a/provisioning/templates/server-info.php.j2 b/provisioning/templates/server-info.php.j2 new file mode 100644 index 000000000..147cebcdd --- /dev/null +++ b/provisioning/templates/server-info.php.j2 @@ -0,0 +1 @@ +<?php phpinfo(); ?> From 37cf5eac595d3d54c6b76ae33fe8af6771fdd57c Mon Sep 17 00:00:00 2001 From: Dan Bohea <git@bohea.co.uk> Date: Sat, 4 Jun 2016 14:27:05 +0100 Subject: [PATCH 0311/1273] configure_local_drush_aliases renamed to configure_drush_aliases - Addresses #662 - Includes shim as this is a breaking change --- docs/extras/drush.md | 2 +- example.config.yml | 2 +- provisioning/tasks/drush-aliases.yml | 16 +++++++++++----- provisioning/templates/dashboard.html.j2 | 4 ++-- 4 files changed, 15 insertions(+), 9 deletions(-) diff --git a/docs/extras/drush.md b/docs/extras/drush.md index 9aabd7cb7..6f3368428 100644 --- a/docs/extras/drush.md +++ b/docs/extras/drush.md @@ -35,7 +35,7 @@ $ drush @drupalvm.dev status Drupal VM automatically generates a drush alias file in `~/.drush/drupalvm.aliases.drushrc.php` with an alias for every site you have defined in the `apache_vhosts` variable. -You can disable Drupal VM's automatic Drush alias file management if you want to manage drush aliases on your own. Just set the `configure_local_drush_aliases` variable in `config.yml` to `false`. +You can disable Drupal VM's automatic Drush alias file management if you want to manage drush aliases on your own. Just set the `configure_drush_aliases` variable in `config.yml` to `false`. ## Using sql-sync diff --git a/example.config.yml b/example.config.yml index 9e5255fa1..45cef2244 100644 --- a/example.config.yml +++ b/example.config.yml @@ -71,7 +71,7 @@ drupalvm_cron_jobs: [] # Drupal VM automatically creates a drush alias file in your ~/.drush folder if # this variable is 'true'. -configure_local_drush_aliases: true +configure_drush_aliases: true # Apache VirtualHosts. Add one for each site you are running inside the VM. For # multisite deployments, you can point multiple servernames at one documentroot. diff --git a/provisioning/tasks/drush-aliases.yml b/provisioning/tasks/drush-aliases.yml index a9d85a62a..3021f9180 100644 --- a/provisioning/tasks/drush-aliases.yml +++ b/provisioning/tasks/drush-aliases.yml @@ -1,11 +1,17 @@ --- +# TODO: Deprecate legacy variable & remove shim in next major release. +- name: Shim for legacy configure_local_drush_aliases variable. + set_fact: + configure_drush_aliases: "{{ configure_local_drush_aliases }}" + when: configure_local_drush_aliases is defined and configure_drush_aliases is undefined + - name: Check if local Drush configuration folder exists. stat: path: ~/.drush register: local_drush_config_folder delegate_to: 127.0.0.1 become: no - when: configure_local_drush_aliases + when: configure_drush_aliases - name: Create Drush configuration folder if it doesn't exist. file: @@ -13,7 +19,7 @@ state: directory delegate_to: 127.0.0.1 become: no - when: configure_local_drush_aliases and (local_drush_config_folder.stat.exists == false) + when: configure_drush_aliases and (local_drush_config_folder.stat.exists == false) # Note that this doesn't work for Windows, since Ansible's running in the VM. - name: Configure host machine drush aliases. @@ -22,7 +28,7 @@ dest: "~/.drush/{{ vagrant_machine_name }}.aliases.drushrc.php" delegate_to: 127.0.0.1 become: no - when: configure_local_drush_aliases + when: configure_drush_aliases - name: Ensure drush directory exists for vagrant user inside VM. file: 'path="~/.drush" state=directory' @@ -33,7 +39,7 @@ src: ../templates/drupalvm-local.aliases.drushrc.php.j2 dest: "~/.drush/{{ vagrant_machine_name }}.aliases.drushrc.php" become: no - when: configure_local_drush_aliases + when: configure_drush_aliases - name: Ensure drush directory exists for root user inside VM. file: 'path="~/.drush" state=directory' @@ -42,4 +48,4 @@ template: src: ../templates/drupalvm-local.aliases.drushrc.php.j2 dest: "~/.drush/{{ vagrant_machine_name }}.aliases.drushrc.php" - when: configure_local_drush_aliases + when: configure_drush_aliases diff --git a/provisioning/templates/dashboard.html.j2 b/provisioning/templates/dashboard.html.j2 index 194895896..1f4dafb60 100644 --- a/provisioning/templates/dashboard.html.j2 +++ b/provisioning/templates/dashboard.html.j2 @@ -41,7 +41,7 @@ <tr> <td><a href="http://{{ servername }}">{{ servername }}</a></td> <td><code>{{ docroot }}</code></td> - {% if configure_local_drush_aliases %} + {% if configure_drush_aliases %} <td><code>drush @{{ vagrant_machine_name }}.{{ servername }}</code></td> {% endif %} </tr> @@ -90,7 +90,7 @@ <tr> <th>Hostname</th> <th>Document Root</th> - {% if configure_local_drush_aliases -%} + {% if configure_drush_aliases -%} <th>Drush alias*</th> {%- endif %} </thead> From 00360526670a068509bbffdd615c20425c0dd33a Mon Sep 17 00:00:00 2001 From: Dan Bohea <git@bohea.co.uk> Date: Sat, 4 Jun 2016 14:27:05 +0100 Subject: [PATCH 0312/1273] configure_local_drush_aliases renamed to configure_drush_aliases - Addresses #662 - Includes shim as this is a breaking change --- default.config.yml | 2 +- docs/extras/drush.md | 2 +- provisioning/tasks/drush-aliases.yml | 16 +++++++++++----- provisioning/templates/dashboard.html.j2 | 4 ++-- 4 files changed, 15 insertions(+), 9 deletions(-) diff --git a/default.config.yml b/default.config.yml index 6f433612e..4b2e46e05 100644 --- a/default.config.yml +++ b/default.config.yml @@ -71,7 +71,7 @@ drupalvm_cron_jobs: [] # Drupal VM automatically creates a drush alias file in your ~/.drush folder if # this variable is 'true'. -configure_local_drush_aliases: true +configure_drush_aliases: true # Apache VirtualHosts. Add one for each site you are running inside the VM. For # multisite deployments, you can point multiple servernames at one documentroot. diff --git a/docs/extras/drush.md b/docs/extras/drush.md index de68518a9..c0b6ab96c 100644 --- a/docs/extras/drush.md +++ b/docs/extras/drush.md @@ -35,7 +35,7 @@ $ drush @drupalvm.dev status Drupal VM automatically generates a drush alias file in `~/.drush/drupalvm.aliases.drushrc.php` with an alias for every site you have defined in the `apache_vhosts` variable. -You can disable Drupal VM's automatic Drush alias file management if you want to manage drush aliases on your own. Just set the `configure_local_drush_aliases` variable in `config.yml` to `false`. +You can disable Drupal VM's automatic Drush alias file management if you want to manage drush aliases on your own. Just set the `configure_drush_aliases` variable in `config.yml` to `false`. ## Using sql-sync diff --git a/provisioning/tasks/drush-aliases.yml b/provisioning/tasks/drush-aliases.yml index a9d85a62a..3021f9180 100644 --- a/provisioning/tasks/drush-aliases.yml +++ b/provisioning/tasks/drush-aliases.yml @@ -1,11 +1,17 @@ --- +# TODO: Deprecate legacy variable & remove shim in next major release. +- name: Shim for legacy configure_local_drush_aliases variable. + set_fact: + configure_drush_aliases: "{{ configure_local_drush_aliases }}" + when: configure_local_drush_aliases is defined and configure_drush_aliases is undefined + - name: Check if local Drush configuration folder exists. stat: path: ~/.drush register: local_drush_config_folder delegate_to: 127.0.0.1 become: no - when: configure_local_drush_aliases + when: configure_drush_aliases - name: Create Drush configuration folder if it doesn't exist. file: @@ -13,7 +19,7 @@ state: directory delegate_to: 127.0.0.1 become: no - when: configure_local_drush_aliases and (local_drush_config_folder.stat.exists == false) + when: configure_drush_aliases and (local_drush_config_folder.stat.exists == false) # Note that this doesn't work for Windows, since Ansible's running in the VM. - name: Configure host machine drush aliases. @@ -22,7 +28,7 @@ dest: "~/.drush/{{ vagrant_machine_name }}.aliases.drushrc.php" delegate_to: 127.0.0.1 become: no - when: configure_local_drush_aliases + when: configure_drush_aliases - name: Ensure drush directory exists for vagrant user inside VM. file: 'path="~/.drush" state=directory' @@ -33,7 +39,7 @@ src: ../templates/drupalvm-local.aliases.drushrc.php.j2 dest: "~/.drush/{{ vagrant_machine_name }}.aliases.drushrc.php" become: no - when: configure_local_drush_aliases + when: configure_drush_aliases - name: Ensure drush directory exists for root user inside VM. file: 'path="~/.drush" state=directory' @@ -42,4 +48,4 @@ template: src: ../templates/drupalvm-local.aliases.drushrc.php.j2 dest: "~/.drush/{{ vagrant_machine_name }}.aliases.drushrc.php" - when: configure_local_drush_aliases + when: configure_drush_aliases diff --git a/provisioning/templates/dashboard.html.j2 b/provisioning/templates/dashboard.html.j2 index 237ffab74..db8e0894a 100644 --- a/provisioning/templates/dashboard.html.j2 +++ b/provisioning/templates/dashboard.html.j2 @@ -41,7 +41,7 @@ <tr> <td><a href="http://{{ servername }}">{{ servername }}</a></td> <td><code>{{ docroot }}</code></td> - {% if configure_local_drush_aliases %} + {% if configure_drush_aliases %} <td><code>drush @{{ vagrant_machine_name }}.{{ servername }}</code></td> {% endif %} </tr> @@ -90,7 +90,7 @@ <tr> <th>Hostname</th> <th>Document Root</th> - {% if configure_local_drush_aliases -%} + {% if configure_drush_aliases -%} <th>Drush alias*</th> {%- endif %} </thead> From 25c32df8a4610855ad4c4d3b4e96ce28889977fa Mon Sep 17 00:00:00 2001 From: Jeff Geerling <geerlingguy@mac.com> Date: Sat, 4 Jun 2016 16:32:54 -0500 Subject: [PATCH 0313/1273] Fixes #696: Document getting xhprof to work with PHP 5.6. --- docs/extras/profile-code.md | 9 ++++++++- docs/other/php-56.md | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/docs/extras/profile-code.md b/docs/extras/profile-code.md index 28d6a0c54..32d2a2a01 100644 --- a/docs/extras/profile-code.md +++ b/docs/extras/profile-code.md @@ -28,7 +28,14 @@ SQL n/a - ## XHProf -[XHProf](http://xhprof.io/) allows easy code profiling and can be used in many different ways. Ensure `xhprof` is in the list of `installed_extras` inside `config.yml`. +[XHProf](http://xhprof.io/) allows easy code profiling and can be used in many different ways. Ensure `xhprof` is in the list of `installed_extras` inside `config.yml`, and if you're using PHP 5.6, make sure you also add the following variables inside `config.yml`: + +``` +xhprof_download_url: https://github.com/phacility/xhprof/archive/master.tar.gz +xhprof_download_folder_name: xhprof-master +``` + +This will ensure the version of XHProf installed is compatible with the older version of PHP. ### XHProf module diff --git a/docs/other/php-56.md b/docs/other/php-56.md index 4ede21643..4fecd645f 100644 --- a/docs/other/php-56.md +++ b/docs/other/php-56.md @@ -6,7 +6,7 @@ _Note: If you have Ansible installed on your host machine, make sure you're runn Ubuntu 16.04 Xenial defaults to PHP 7.0 in it's system packages. No older versions of PHP will be supported if using this base box. -## Ubuntu 14.04 +## Ubuntu 14.04 / Ubuntu 12.04 Ondřej Surý's PPA for PHP 7.0 is used to install PHP 7, but you can switch to using different 5.6 packages instead by making the following changes to `config.yml`: From dd8e8eaf3d92d284cc4da0b7fca848a53119c1e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oskar=20Sch=C3=B6ldstr=C3=B6m?= <public@oxy.fi> Date: Sat, 4 Jun 2016 21:25:42 -0400 Subject: [PATCH 0314/1273] Issue #284: Add docs about vagrant-bindfs --- docs/extras/syncing-folders.md | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/docs/extras/syncing-folders.md b/docs/extras/syncing-folders.md index 37a11c011..cacda49a7 100644 --- a/docs/extras/syncing-folders.md +++ b/docs/extras/syncing-folders.md @@ -103,6 +103,30 @@ mount_options: ["dmode=775,fmode=664"] See [this issue](https://github.com/geerlingguy/drupal-vm/issues/66) for more details. +### Using [`vagrant-bindfs`](https://github.com/gael-ian/vagrant-bindfs) to work around permissions-related errors + +If you're using NFS synced folders the mounted directories will use the same numeric permissions on the guest VM as on the host OS. If you're on OSX for instance, your files within the VM would be owned by 501:20. To correct these permissions you can use the [`vagrant-bindfs` plugin](https://github.com/gael-ian/vagrant-bindfs) to mount your NFS folders to a temporary location and then re-mount them to the actual destination with the correct ownership. + +First install the plugin with `vagrant plugin install vagrant-bindfs` and then add a `Vagrantfile.local` with the following: + +```rb +vconfig['vagrant_synced_folders'].each do |synced_folder| + case synced_folder['type'] + when "nfs" + guest_path = synced_folder['destination'] + host_path = File.expand_path(synced_folder['local_path']) + config.vm.synced_folders[guest_path][:guestpath] = "/var/nfs#{host_path}" + config.bindfs.bind_folder "/var/nfs#{host_path}", guest_path, + u: 'vagrant', + g: 'www-data', + perms: 'u=rwX:g=rwD', + o: 'nonempty' + config.nfs.map_uid = Process.uid + config.nfs.map_gid = Process.gid + end +end +``` + ### Other NFS-related errors If you're having other weird issues, and none of the above fixes helps, you might want to try a different synced folder method (see top of this page), or something like File Conveyor or a special rsync setup (see [here](http://wolfgangziegler.net/auto-rsync-local-changes-to-remote-server#comments) for some examples). From dedb5204f6cf085e0a2ed14812e3106cde2fdfa7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oskar=20Sch=C3=B6ldstr=C3=B6m?= <public@oxy.fi> Date: Fri, 3 Jun 2016 13:06:17 -0400 Subject: [PATCH 0315/1273] Add support for composer-based drupal site builds --- .travis.yml | 2 + README.md | 2 +- default.config.yml | 27 +++++-- docs/deployment/composer.md | 71 +++++++++++++++++++ example.drupal.composer.json | 35 +++++++++ mkdocs.yml | 1 + provisioning/playbook.yml | 13 ++++ provisioning/tasks/build-composer-project.yml | 15 ++++ provisioning/tasks/build-composer.yml | 29 ++++++++ provisioning/tasks/build-makefile.yml | 10 +-- tests/ubuntu-16-nginx.config.yml | 5 ++ 11 files changed, 197 insertions(+), 13 deletions(-) create mode 100644 docs/deployment/composer.md create mode 100644 example.drupal.composer.json create mode 100644 provisioning/tasks/build-composer-project.yml create mode 100644 provisioning/tasks/build-composer.yml diff --git a/.travis.yml b/.travis.yml index 4fd1c1096..3a8ab7b07 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,6 +5,7 @@ env: global: - CONFIG: tests/config.yml MAKEFILE: example.drupal.make.yml + COMPOSERFILE: example.drupal.composer.json HOSTNAME: drupalvm.dev MACHINE_NAME: drupalvm IP: 192.168.88.88 @@ -57,6 +58,7 @@ script: # Copy configuration files into place. - 'sudo docker exec "$(cat ${container_id})" cp ${DRUPALVM_DIR}/${CONFIG} ${config_dir:-$DRUPALVM_DIR}/config.yml' - 'sudo docker exec "$(cat ${container_id})" cp ${DRUPALVM_DIR}/${MAKEFILE} ${config_dir:-$DRUPALVM_DIR}/drupal.make.yml' + - 'sudo docker exec "$(cat ${container_id})" cp ${DRUPALVM_DIR}/${COMPOSERFILE} ${config_dir:-$DRUPALVM_DIR}/drupal.composer.json' # Override configuration variables. - '[[ ! -z "${local_config}" ]] && sudo docker exec "$(cat ${container_id})" bash -c "cp ${DRUPALVM_DIR}/${local_config} ${config_dir:-$DRUPALVM_DIR}/local.config.yml" || true' diff --git a/README.md b/README.md index d0b684e46..9a81d8c56 100644 --- a/README.md +++ b/README.md @@ -52,7 +52,7 @@ If you want to switch from Drupal 8 (default) to Drupal 7 on the initial install ## Quick Start Guide -This Quick Start Guide will help you quickly build a Drupal 8 site on the Drupal VM using the included example Drush make file. You can also use the Drupal VM with a [Local Drupal codebase](http://docs.drupalvm.com/en/latest/deployment/local-codebase/) or even a [Drupal multisite installation](http://docs.drupalvm.com/en/latest/deployment/multisite/). +This Quick Start Guide will help you quickly build a Drupal 8 site on the Drupal VM using the included example Drush make file. You can also use the Drupal VM with a [Composer based installation](http://docs.drupalvm.com/en/latest/deployment/composer/), with a [Local Drupal codebase](http://docs.drupalvm.com/en/latest/deployment/local-codebase/) or even a [Drupal multisite installation](http://docs.drupalvm.com/en/latest/deployment/multisite/). ### 1 - Install Vagrant diff --git a/default.config.yml b/default.config.yml index 4b2e46e05..212fa082e 100644 --- a/default.config.yml +++ b/default.config.yml @@ -21,7 +21,8 @@ vagrant_public_ip: "" # http://docs.drupalvm.com/en/latest/extras/syncing-folders/ for more info. vagrant_synced_folders: # The first synced folder will be used for the default Drupal installation, if - # build_makefile: is 'true'. By default it's set to the drupal-vm folder. + # any of the build_* settings are 'true'. By default the folder is set to + # the drupal-vm folder. - local_path: . destination: /var/www/drupalvm type: nfs @@ -34,17 +35,29 @@ vagrant_cpus: 2 # The web server software to use. Can be either 'apache' or 'nginx'. drupalvm_webserver: apache -# Set this to false if you are using a different site deployment strategy and +# Set this to 'false' if you are using a different site deployment strategy and # would like to configure 'vagrant_synced_folders' and 'apache_vhosts' manually. build_makefile: true drush_makefile_path: "{{ config_dir }}/drupal.make.yml" -# Set this to false if you don't need to install drupal (using the drupal_* +# Set 'build_makefile' to 'false' and this to 'true' if you are using a +# composer based site deployment strategy. +build_composer: false +drupal_composer_path: "{{ config_dir }}/drupal.composer.json" +drupal_composer_install_dir: "/var/www/drupalvm/drupal" +drupal_composer_dependencies: [] + +# Set this to 'true' and 'build_makefile', 'build_composer' to 'false' if you +# are using Composer's create-project as a site deployment strategy. +build_composer_project: false +drupal_composer_project_package: "" +drupal_composer_project_options: "--prefer-dist --stability dev --no-interaction" + +# Set this to 'false' if you don't need to install drupal (using the drupal_* # settings below), but instead copy down a database (e.g. using drush sql-sync). install_site: true -# Settings for building a Drupal site from a makefile (if 'build_makefile:' -# is 'true'). +# Settings for installing a Drupal site (if 'install_site:' is 'true'). drupal_major_version: 8 drupal_core_path: "/var/www/drupalvm/drupal" drupal_domain: "{{ vagrant_hostname }}" @@ -138,8 +151,8 @@ nginx_hosts: nginx_remove_default_vhost: true nginx_ppa_use: true -# MySQL Databases and users. If build_makefile: is true, first database will -# be used for the makefile-built site. +# MySQL Databases and users. If 'install_site' is 'true', first database will +# be used for the site. mysql_databases: - name: "{{ drupal_mysql_database }}" encoding: utf8 diff --git a/docs/deployment/composer.md b/docs/deployment/composer.md new file mode 100644 index 000000000..49841b209 --- /dev/null +++ b/docs/deployment/composer.md @@ -0,0 +1,71 @@ +Drupal VM is configured to use [Drush make](drush-make.md) by default but supports building Drupal from a custom composer.json or creating a project from a composer package (`composer create-project`). + +## Using composer.json + +1. Copy `example.drupal.composer.json` to `drupal.composer.json` and modify it to your liking. +2. Switch the build system by setting `build_makefile: false` and `build_composer: true` in your `config.yml`. +3. Configure `drupal_core_path` to point to the webroot directory: `drupal_core_path: {{ drupal_composer_install_dir }}/docroot` + +```yaml +build_makefile: false +build_composer: true +drupal_core_path: "{{ drupal_composer_install_dir }}/docroot" +``` + +_The file set in `drupal_composer_path` (which defaults to `drupal.composer.json`) will be copied from your host computer into the VM's `drupal_composer_install_dir` and renamed `composer.json`. If you already have a composer.json within that directory, you can set `drupal_composer_path: false`._ + +## Using Composer when [Drupal VM is a composer dependency itself](../other/drupalvm-composer-dependency.md) + +In the scenario where you already have an existing `composer.json` in the root of your project, follow the usual steps for installing with a composer.json but instead of creating a `drupal.composer.json` file, disable the transfering of the file by setting `drupal_composer_path` to `false`, and change `drupal_composer_install_dir` to point to the the directory where it will be located. If `drupal_composer_path` is not truthy, Drupal VM assumes it already exists. + +```yaml +build_makefile: false +build_composer: true +drupal_composer_path: false +drupal_composer_install_dir: "/var/www/drupalvm" +drupal_core_path: "{{ drupal_composer_install_dir }}/docroot" +``` + +## Creating a project from a composer package: `composer create-project` + +There's a couple of things you need to configure in your `config.yml`: + +- Switch the build system by setting `build_makefile: false`, `build_composer: false` and `build_composer_project: true`. +- Configure the composer package in `drupal_composer_project_package`. +- Additionally you can adjust the create-project CLI options in `drupal_composer_project_options` as well as add additional dependencies in `drupal_composer_dependencies`. +- Ensure that the webroot configured in the composer package matches the one set in `drupal_core_path`. + +With [drupal-composer/drupal-project](https://github.com/drupal-composer/drupal-project) as an example your `config.yml` overrides would be: + +```yaml +build_makefile: false +build_composer: false +build_composer_project: true + +drupal_composer_project_package: "drupal-composer/drupal-project:8.x-dev" +# Added `--no-dev` to avoid installing development dependencies. +drupal_composer_project_options: "--prefer-dist --stability dev --no-interaction --no-dev" +drupal_composer_dependencies: + - "drupal/devel:8.*" + +drupal_core_path: "{{ drupal_composer_install_dir }}/web" +``` + +## Improving composer build performance + +Opting for composer based installs will most likely increase your VM's time to provision considerably. + +If you manage multiple VM's own your computer, you can use the [`vagrant-cachier` plugin](http://fgrehm.viewdocs.io/vagrant-cachier/) to share Composer's package cache across all VM's. The first build will be as slow as before but subsequent builds with the same `vagrant_box` (eg `geerlingguy/ubuntu1604`) will be much faster. + +1. Install the plugin on your host computer: `vagrant plugin install vagrant-cachier` +2. Create a `Vagrantfile.local` next to your `config.yml` with the following: + +```rb +config.cache.scope = :box +config.cache.auto_detect = false +config.cache.enable :generic, { :cache_dir => "/home/vagrant/.composer/cache" } +``` + +_Note: Out of the box, sharing the Composer cache is not supported as the plugin requires PHP to be installed when the VM first boots up. This is why the generic cache bucket is used instead._ + +_You can also use this plugin to share other package manager caches. For more information read the [documentation](http://fgrehm.viewdocs.io/vagrant-cachier/usage/)._ diff --git a/example.drupal.composer.json b/example.drupal.composer.json new file mode 100644 index 000000000..528047ef7 --- /dev/null +++ b/example.drupal.composer.json @@ -0,0 +1,35 @@ +{ + "name": "custom-project/drupal-vm", + "description": "", + "type": "project", + "license": "MIT", + "authors": [ + { + "name": "", + "role": "" + } + ], + "repositories": [ + { + "type": "composer", + "url": "https://packagist.drupal-composer.org" + } + ], + "require": { + "composer/installers": "^1.0.20", + "drupal-composer/drupal-scaffold": "^2.0.1", + "drupal/core": "~8.0", + "drupal/devel": "8.*" + }, + "minimum-stability": "dev", + "prefer-stable": true, + "extra": { + "installer-paths": { + "docroot/core": ["type:drupal-core"], + "docroot/modules/contrib/{$name}": ["type:drupal-module"], + "docroot/profiles/contrib/{$name}": ["type:drupal-profile"], + "docroot/themes/contrib/{$name}": ["type:drupal-theme"], + "drush/contrib/{$name}": ["type:drupal-drush"] + } + } +} diff --git a/mkdocs.yml b/mkdocs.yml index a802b3eee..681311816 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -12,6 +12,7 @@ pages: - Home: 'index.md' - Drupal Deployment Strategies: - 'Drush Make file': 'deployment/drush-make.md' + - 'Composer': 'deployment/composer.md' - 'Local Drupal codebase': 'deployment/local-codebase.md' - 'Drupal multisite': 'deployment/multisite.md' - Extra Software and Setup: diff --git a/provisioning/playbook.yml b/provisioning/playbook.yml index 453fcc50a..df50ee94c 100644 --- a/provisioning/playbook.yml +++ b/provisioning/playbook.yml @@ -80,6 +80,11 @@ - name: Check if Drupal is already set up. stat: "path={{ drupal_core_path }}/index.php" register: drupal_site + ignore_errors: true + + - name: Define drupal_site_exists + set_fact: + drupal_site_exists: "{{ drupal_site.stat.exists|default(false) }}" - include: tasks/sshd.yml - include: tasks/extras.yml @@ -91,6 +96,14 @@ - include: tasks/build-makefile.yml when: build_makefile + # Build with composer if configured. + - include: tasks/build-composer.yml + when: build_composer + + # Build a composer project if configured. + - include: tasks/build-composer-project.yml + when: build_composer_project + # Install site if configured. - include: tasks/install-site.yml when: install_site diff --git a/provisioning/tasks/build-composer-project.yml b/provisioning/tasks/build-composer-project.yml new file mode 100644 index 000000000..9964be1ff --- /dev/null +++ b/provisioning/tasks/build-composer-project.yml @@ -0,0 +1,15 @@ +--- +- name: Generate Drupal project with composer package. + command: > + {{ composer_path }} create-project + {{ drupal_composer_project_package }} {{ drupal_composer_install_dir }} + {{ drupal_composer_project_options|default('--prefer-dist --no-interaction') }} + when: not drupal_site_exists + become: no + +- name: Install dependencies with composer require. + command: > + {{ composer_path }} require {{ item }} + chdir={{ drupal_composer_install_dir }} + with_items: "{{ drupal_composer_dependencies|default([]) }}" + become: no diff --git a/provisioning/tasks/build-composer.yml b/provisioning/tasks/build-composer.yml new file mode 100644 index 000000000..7602a3a7c --- /dev/null +++ b/provisioning/tasks/build-composer.yml @@ -0,0 +1,29 @@ +--- +- name: Ensure drupal_composer_install_dir directory exists. + file: + path: "{{ drupal_composer_install_dir }}" + state: directory + mode: 0775 + become: no + when: drupal_composer_path and not drupal_site_exists + +- name: Copy composer.json into place. + copy: + src: "{{ drupal_composer_path }}" + dest: "{{ drupal_composer_install_dir }}/composer.json" + when: drupal_composer_path and not drupal_site_exists + become: no + +- name: Run composer install. + command: > + composer install + chdir={{ drupal_composer_install_dir }} + when: not drupal_site_exists + become: no + +- name: Install dependencies with composer require. + command: > + {{ composer_path }} require {{ item }} + chdir={{ drupal_composer_install_dir }} + with_items: "{{ drupal_composer_dependencies|default([]) }}" + become: no diff --git a/provisioning/tasks/build-makefile.yml b/provisioning/tasks/build-makefile.yml index c74c9ce6f..862cb5acc 100644 --- a/provisioning/tasks/build-makefile.yml +++ b/provisioning/tasks/build-makefile.yml @@ -3,7 +3,7 @@ copy: src: "{{ drush_makefile_path }}" dest: /tmp/drupal.make.yml - when: drupal_site.stat.exists == false + when: not drupal_site_exists - name: Ensure drupal_core_path directory exists. file: @@ -12,23 +12,23 @@ recurse: yes mode: 0775 become: no - when: drupal_site.stat.exists == false + when: not drupal_site_exists - name: Generate Drupal site with drush makefile. command: > {{ drush_path }} make -y /tmp/drupal.make.yml --no-gitinfofile chdir={{ drupal_core_path }} - when: drupal_site.stat.exists == false + when: not drupal_site_exists become: no - name: Check if a composer.json file is present. stat: "path={{ drupal_core_path }}/composer.json" register: drupal_core_composer_file - when: drupal_site.stat.exists == false + when: not drupal_site_exists - name: Run composer install if composer.json is present. command: > composer install chdir={{ drupal_core_path }} - when: drupal_site.stat.exists == false and drupal_core_composer_file.stat.exists == true + when: not drupal_site_exists and drupal_core_composer_file.stat.exists become: no diff --git a/tests/ubuntu-16-nginx.config.yml b/tests/ubuntu-16-nginx.config.yml index 44ee51312..f1499c644 100644 --- a/tests/ubuntu-16-nginx.config.yml +++ b/tests/ubuntu-16-nginx.config.yml @@ -1,2 +1,7 @@ --- drupalvm_webserver: nginx + +# Test composer based installation. +build_makefile: false +build_composer: true +drupal_core_path: "{{ drupal_composer_install_dir }}/docroot" From c5c8c8a19b87c09efd85fbcf3ec80211ce9b8025 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oskar=20Sch=C3=B6ldstr=C3=B6m?= <public@oxy.fi> Date: Sat, 4 Jun 2016 13:44:37 -0400 Subject: [PATCH 0316/1273] Add prestissimo as a default global composer package --- default.config.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/default.config.yml b/default.config.yml index 212fa082e..a9080bef6 100644 --- a/default.config.yml +++ b/default.config.yml @@ -240,8 +240,8 @@ composer_path: /usr/bin/composer composer_home_path: "/home/{{ drupalvm_user }}/.composer" composer_home_owner: "{{ drupalvm_user }}" composer_home_group: "{{ drupalvm_user }}" -# composer_global_packages: -# - { name: phpunit/phpunit, release: '@stable' } +composer_global_packages: + - { name: hirak/prestissimo, release: '^0.2' } # Run specified scripts before or after VM is provisioned. Path is relative to # the `provisioning/playbook.yml` file. From d828f776bea10b4c988f8c2a21360ad257de322c Mon Sep 17 00:00:00 2001 From: Jeff Geerling <geerlingguy@mac.com> Date: Sat, 4 Jun 2016 21:42:48 -0500 Subject: [PATCH 0317/1273] Bump requirements for latest versions of PHP and Varnish roles. --- provisioning/requirements.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/provisioning/requirements.yml b/provisioning/requirements.yml index 8def01576..c4b47fe03 100644 --- a/provisioning/requirements.yml +++ b/provisioning/requirements.yml @@ -36,7 +36,7 @@ - src: geerlingguy.nodejs version: 3.0.0 - src: geerlingguy.php - version: 3.0.4 + version: 3.1.0 - src: geerlingguy.php-memcached version: 2.0.0 - src: geerlingguy.php-mysql @@ -64,4 +64,4 @@ - src: geerlingguy.solr version: 3.1.0 - src: geerlingguy.varnish - version: 1.6.0 + version: 1.6.1 From d0cd3953679c31946726e8ccd11b9fed67eaceb6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oskar=20Sch=C3=B6ldstr=C3=B6m?= <public@oxy.fi> Date: Sun, 5 Jun 2016 10:50:33 -0400 Subject: [PATCH 0318/1273] Use composer project based site build as the default --- default.config.yml | 13 +++++++------ tests/ubuntu-16-nginx.config.yml | 8 ++++---- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/default.config.yml b/default.config.yml index a9080bef6..759c2f573 100644 --- a/default.config.yml +++ b/default.config.yml @@ -37,7 +37,7 @@ drupalvm_webserver: apache # Set this to 'false' if you are using a different site deployment strategy and # would like to configure 'vagrant_synced_folders' and 'apache_vhosts' manually. -build_makefile: true +build_makefile: false drush_makefile_path: "{{ config_dir }}/drupal.make.yml" # Set 'build_makefile' to 'false' and this to 'true' if you are using a @@ -45,12 +45,13 @@ drush_makefile_path: "{{ config_dir }}/drupal.make.yml" build_composer: false drupal_composer_path: "{{ config_dir }}/drupal.composer.json" drupal_composer_install_dir: "/var/www/drupalvm/drupal" -drupal_composer_dependencies: [] +drupal_composer_dependencies: + - "drupal/devel:8.*" # Set this to 'true' and 'build_makefile', 'build_composer' to 'false' if you # are using Composer's create-project as a site deployment strategy. -build_composer_project: false -drupal_composer_project_package: "" +build_composer_project: true +drupal_composer_project_package: "drupal-composer/drupal-project:8.x-dev" drupal_composer_project_options: "--prefer-dist --stability dev --no-interaction" # Set this to 'false' if you don't need to install drupal (using the drupal_* @@ -59,7 +60,7 @@ install_site: true # Settings for installing a Drupal site (if 'install_site:' is 'true'). drupal_major_version: 8 -drupal_core_path: "/var/www/drupalvm/drupal" +drupal_core_path: "{{ drupal_composer_install_dir }}/web" drupal_domain: "{{ vagrant_hostname }}" drupal_site_name: "Drupal" drupal_install_profile: standard @@ -241,7 +242,7 @@ composer_home_path: "/home/{{ drupalvm_user }}/.composer" composer_home_owner: "{{ drupalvm_user }}" composer_home_group: "{{ drupalvm_user }}" composer_global_packages: - - { name: hirak/prestissimo, release: '^0.2' } + - { name: hirak/prestissimo, release: '^0.3' } # Run specified scripts before or after VM is provisioned. Path is relative to # the `provisioning/playbook.yml` file. diff --git a/tests/ubuntu-16-nginx.config.yml b/tests/ubuntu-16-nginx.config.yml index f1499c644..c3c8833c5 100644 --- a/tests/ubuntu-16-nginx.config.yml +++ b/tests/ubuntu-16-nginx.config.yml @@ -1,7 +1,7 @@ --- drupalvm_webserver: nginx -# Test composer based installation. -build_makefile: false -build_composer: true -drupal_core_path: "{{ drupal_composer_install_dir }}/docroot" +# Test makefile based installation. +build_makefile: true +build_composer_project: false +drupal_core_path: "/var/www/drupalvm/drupal" From 52b7c02fedb85815df4120c7229fe381a6897009 Mon Sep 17 00:00:00 2001 From: Jeff Geerling <geerlingguy@mac.com> Date: Sun, 5 Jun 2016 21:39:22 -0500 Subject: [PATCH 0319/1273] Fixes #702: Include default vagrant-cachier configuration. --- Vagrantfile | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/Vagrantfile b/Vagrantfile index 769c148c0..432ab2bc1 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -175,6 +175,20 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| # Set the name of the VM. See: http://stackoverflow.com/a/17864388/100134 config.vm.define vconfig['vagrant_machine_name'] + # Cache packages and dependencies if vagrant-cachier plugin is present. + if Vagrant.has_plugin?('vagrant-cachier') + config.cache.scope = :box + config.cache.auto_detect = false + config.cache.enable :apt + # Cache the composer directory. + config.cache.enable :generic, cache_dir: '/home/vagrant/.composer/cache' + # Cache via NFS shares. + config.cache.synced_folder_opts = { + type: :nfs, + mount_options: ['rw', 'vers=3', 'tcp', 'nolock'] + } + end + # Allow an untracked Vagrantfile to modify the configurations eval File.read "#{host_config_dir}/Vagrantfile.local" if File.exist?("#{host_config_dir}/Vagrantfile.local") end From cc708d411497d4e2ef32f0cd1bc9ad04b17b3f2d Mon Sep 17 00:00:00 2001 From: Jeff Geerling <geerlingguy@mac.com> Date: Mon, 6 Jun 2016 09:28:16 -0500 Subject: [PATCH 0320/1273] Issue #704: Update documentation for Composer-based install default. --- docs/deployment/composer.md | 27 ++++++++++----------------- docs/deployment/drush-make.md | 4 ++-- docs/deployment/local-codebase.md | 8 +++++--- docs/deployment/multisite.md | 2 +- 4 files changed, 18 insertions(+), 23 deletions(-) diff --git a/docs/deployment/composer.md b/docs/deployment/composer.md index 49841b209..e643f57cf 100644 --- a/docs/deployment/composer.md +++ b/docs/deployment/composer.md @@ -1,9 +1,9 @@ -Drupal VM is configured to use [Drush make](drush-make.md) by default but supports building Drupal from a custom composer.json or creating a project from a composer package (`composer create-project`). +Drupal VM is configured to use `composer create-project` to build a Drupal 8 codebase by default but supports building Drupal from a custom composer.json or [Drush make file](drush-make.md). ## Using composer.json 1. Copy `example.drupal.composer.json` to `drupal.composer.json` and modify it to your liking. -2. Switch the build system by setting `build_makefile: false` and `build_composer: true` in your `config.yml`. +2. Use the Composer build system by setting `build_composer: true` in your `config.yml` (make sure `build_makefile` is set to `false`). 3. Configure `drupal_core_path` to point to the webroot directory: `drupal_core_path: {{ drupal_composer_install_dir }}/docroot` ```yaml @@ -28,14 +28,14 @@ drupal_core_path: "{{ drupal_composer_install_dir }}/docroot" ## Creating a project from a composer package: `composer create-project` -There's a couple of things you need to configure in your `config.yml`: +This is the default Drupal VM build configuration, set up by the following settings in `config.yml`: -- Switch the build system by setting `build_makefile: false`, `build_composer: false` and `build_composer_project: true`. -- Configure the composer package in `drupal_composer_project_package`. -- Additionally you can adjust the create-project CLI options in `drupal_composer_project_options` as well as add additional dependencies in `drupal_composer_dependencies`. -- Ensure that the webroot configured in the composer package matches the one set in `drupal_core_path`. + - Composer will build the project if `build_composer_project` is `true`, and `build_makefile` and `build_composer` are both `false`. + - The Composer package is defined by `drupal_composer_project_package`. + - Adjust the create-project CLI options in `drupal_composer_project_options` as well as add additional dependencies in `drupal_composer_dependencies`. + - Ensure that the webroot configured in the Composer package matches the one set in `drupal_core_path`. -With [drupal-composer/drupal-project](https://github.com/drupal-composer/drupal-project) as an example your `config.yml` overrides would be: +With [drupal-composer/drupal-project](https://github.com/drupal-composer/drupal-project) as an example your `config.yml` settings would be: ```yaml build_makefile: false @@ -57,15 +57,8 @@ Opting for composer based installs will most likely increase your VM's time to p If you manage multiple VM's own your computer, you can use the [`vagrant-cachier` plugin](http://fgrehm.viewdocs.io/vagrant-cachier/) to share Composer's package cache across all VM's. The first build will be as slow as before but subsequent builds with the same `vagrant_box` (eg `geerlingguy/ubuntu1604`) will be much faster. -1. Install the plugin on your host computer: `vagrant plugin install vagrant-cachier` -2. Create a `Vagrantfile.local` next to your `config.yml` with the following: +Install the plugin on your host computer: `vagrant plugin install vagrant-cachier`. -```rb -config.cache.scope = :box -config.cache.auto_detect = false -config.cache.enable :generic, { :cache_dir => "/home/vagrant/.composer/cache" } -``` - -_Note: Out of the box, sharing the Composer cache is not supported as the plugin requires PHP to be installed when the VM first boots up. This is why the generic cache bucket is used instead._ +Drupal VM's `Vagrantfile` includes the appropriate `vagrant-cachier` configuration to cache Composer and apt dependencies. _You can also use this plugin to share other package manager caches. For more information read the [documentation](http://fgrehm.viewdocs.io/vagrant-cachier/usage/)._ diff --git a/docs/deployment/drush-make.md b/docs/deployment/drush-make.md index 8ce4e93a1..8627661fe 100644 --- a/docs/deployment/drush-make.md +++ b/docs/deployment/drush-make.md @@ -1,5 +1,5 @@ -Drupal VM is configured by default to use a Drush make file to build a Drupal site on the VM inside `/var/www/drupalvm/drupal` (in a folder that's synced to your local machine, so you can work with the Drupal codebase either locally or inside the VM). +Drupal VM is configured to use Composer by default to build a Drupal site on the VM inside `/var/www/drupalvm/drupal` (in a folder that's synced to your local machine, so you can work with the Drupal codebase either locally or inside the VM). -You can use any make file you want, just copy it or symlink it into the root of the Drupal VM folder with the filename `drupal.make.yml`. You can also set a separate path to the makefile using the `drush_makefile_path` variable. +If you want to build a Drupal site using a [Drush make file](http://www.drush.org/en/master/make/) instead, you can either use the `example.drupal.make.yml` file as a base, or use your own Drush make file: just place it or symlink it into the root of the Drupal VM folder with the filename `drupal.make.yml`. You can also set a separate path to the makefile using the `drush_makefile_path` variable. Have a look at the defaults in `default.config.yml` and tweak the settings as you'd like in your `config.yml`, then run `vagrant up` as in the Quick Start Guide. Within a few minutes, you should have your site running and available at the `drupal_domain` configured in `config.yml`, falling back to the default `http://drupalvm.dev` set in `default.config.yml`. diff --git a/docs/deployment/local-codebase.md b/docs/deployment/local-codebase.md index 837d53583..97ecf34b9 100644 --- a/docs/deployment/local-codebase.md +++ b/docs/deployment/local-codebase.md @@ -11,12 +11,14 @@ vagrant_synced_folders: type: nfs ``` -## Disable the Drush make build and site install +## Disable the Composer project build and site install -Set `build_makefile` and `install_site` to `false`: +Set all the `build_` variables and `install_site` to `false`: ```yaml -build_makefile:: false +build_makefile: false +build_composer: false +build_composer_project: true ... install_site: false ``` diff --git a/docs/deployment/multisite.md b/docs/deployment/multisite.md index 0a4471cf8..15b96f95f 100644 --- a/docs/deployment/multisite.md +++ b/docs/deployment/multisite.md @@ -1,4 +1,4 @@ -For multisite installations, make the changes outlined in the [Local Drupal codebase](local-codebase.md) guide, but, using the `apache_vhosts` variable, configure as many domains pointing to the same docroot as you need: +For multisite installations, make the changes outlined in the [Local Drupal codebase](local-codebase.md) guide, but, using the `apache_vhosts` variable (or `nginx_hosts` if using Nginx), configure as many domains pointing to the same docroot as you need: ```yaml drupal_core_path: "/var/www/my-drupal-site" From f959339a292600cae08e28bde81e486b3b7b4d57 Mon Sep 17 00:00:00 2001 From: Jeff Geerling <geerlingguy@mac.com> Date: Mon, 6 Jun 2016 09:37:33 -0500 Subject: [PATCH 0321/1273] Issue #704: Update README.md and quick start guide. --- README.md | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 9a81d8c56..004ff0426 100644 --- a/README.md +++ b/README.md @@ -43,16 +43,25 @@ Full Drupal VM documentation is available at http://docs.drupalvm.com/ There are a couple places where you can customize the VM for your needs: - `config.yml`: Override any of the default VM configuration from `default.config.yml`; customize almost any aspect of any software installed in the VM (more about [overriding configurations](http://docs.drupalvm.com/en/latest/other/overriding-configurations/). - - `drupal.make.yml`: Contains configuration for the Drupal core version, modules, and patches that will be downloaded on Drupal's initial installation (more about [Drush make files](https://www.drupal.org/node/1432374)). + - `drupal.composer.json` or `drupal.make.yml`: Contains configuration for the Drupal core version, modules, and patches that will be downloaded on Drupal's initial installation (you can build using Composer, Drush make, or your own codebase). If you want to switch from Drupal 8 (default) to Drupal 7 on the initial install, do the following: + 1. Switch to using a [Drush Make file](http://docs.drupalvm.com/en/latest/deployment/drush-make/). 1. Update the Drupal `version` and `core` inside the `drupal.make.yml` file. 2. Update `drupal_major_version` inside `config.yml`. ## Quick Start Guide -This Quick Start Guide will help you quickly build a Drupal 8 site on the Drupal VM using the included example Drush make file. You can also use the Drupal VM with a [Composer based installation](http://docs.drupalvm.com/en/latest/deployment/composer/), with a [Local Drupal codebase](http://docs.drupalvm.com/en/latest/deployment/local-codebase/) or even a [Drupal multisite installation](http://docs.drupalvm.com/en/latest/deployment/multisite/). +This Quick Start Guide will help you quickly build a Drupal 8 site on the Drupal VM using Composer with `drupal-project`. You can also use Drupal VM with [Composer](http://docs.drupalvm.com/en/latest/deployment/composer/), a [Drush Make file](http://docs.drupalvm.com/en/latest/deployment/drush-make/), with a [Local Drupal codebase](http://docs.drupalvm.com/en/latest/deployment/local-codebase/), or even a [Drupal multisite installation](http://docs.drupalvm.com/en/latest/deployment/multisite/). + +If you want to install a Drupal 8 site locally with minimal fuss, just: + + 1. Install Vagrant. + 2. Download or clone this project to your workstation. + 3. `cd` into this project directory and run `vagrant up`. + +But Drupal VM allows you to build your site exactly how you like, using whatever tools you need, with almost infinite flexibility and customization! ### 1 - Install Vagrant @@ -64,14 +73,12 @@ Notes: - **For faster provisioning** (Mac/Linux only): *[Install Ansible](http://docs.ansible.com/intro_installation.html) on your host machine, so Drupal VM can run the provisioning steps locally instead of inside the VM.* - **NFS on Linux**: *If NFS is not already installed on your host, you will need to install it to use the default NFS synced folder configuration. See guides for [Debian/Ubuntu](https://www.digitalocean.com/community/tutorials/how-to-set-up-an-nfs-mount-on-ubuntu-14-04), [Arch](https://wiki.archlinux.org/index.php/NFS#Installation), and [RHEL/CentOS](https://www.digitalocean.com/community/tutorials/how-to-set-up-an-nfs-mount-on-centos-6).* - - **Versions**: *Make sure you're running the latest releases of Vagrant, VirtualBox, and Ansible—as of February 2016, Drupal VM recommends: Vagrant 1.8.1, VirtualBox 5.0.14, and Ansible 2.0.0.* + - **Versions**: *Make sure you're running the latest releases of Vagrant, VirtualBox, and Ansible—as of February 2016, Drupal VM recommends: Vagrant 1.8.1, VirtualBox 5.0.20, and Ansible 2.1.0.* ### 2 - Build the Virtual Machine 1. Download this project and put it wherever you want. - 2. Make copies of both example configuration files, and modify to your liking: - - Copy `example.drupal.make.yml` to `drupal.make.yml`. - - Copy `default.config.yml` to `config.yml`. + 2. (Optional) Copy `default.config.yml` to `config.yml` and modify it to your liking. 3. Create a local directory where Drupal will be installed and configure the path to that directory in `config.yml` (`local_path`, inside `vagrant_synced_folders`). 4. Open Terminal, `cd` to this directory (containing the `Vagrantfile` and this README file). 5. Type in `vagrant up`, and let Vagrant do its magic. @@ -145,4 +152,4 @@ This project is licensed under the MIT open source license. ## About the Author -[Jeff Geerling](http://www.jeffgeerling.com/), owner of [Midwestern Mac, LLC](http://www.midwesternmac.com/), created this project in 2014 so he could accelerate his Drupal core and contrib development workflow. This project, and others like it, are also featured as examples in Jeff's book, [Ansible for DevOps](http://www.ansiblefordevops.com/). +[Jeff Geerling](http://www.jeffgeerling.com/) created Drupal VM in 2014 for a more efficient Drupal site and core/contrib development workflow. This project is featured as an example in [Ansible for DevOps](http://www.ansiblefordevops.com/). From 80d3ae5550544bbb6792d7d63bdfc06b1b085181 Mon Sep 17 00:00:00 2001 From: Jeff Geerling <geerlingguy@mac.com> Date: Mon, 6 Jun 2016 09:40:02 -0500 Subject: [PATCH 0322/1273] Issue #704: Update README.md for a little more clarity. --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 004ff0426..2b7973815 100644 --- a/README.md +++ b/README.md @@ -88,8 +88,8 @@ Note: *If there are any errors during the course of running `vagrant up`, and it ### 3 - Configure your host machine to access the VM. 1. [Edit your hosts file](http://www.rackspace.com/knowledge_center/article/how-do-i-modify-my-hosts-file), adding the line `192.168.88.88 drupalvm.dev` so you can connect to the VM. - - You can have Vagrant automatically configure your hosts file if you install the `hostsupdater` plugin (`vagrant plugin install vagrant-hostsupdater`). All hosts defined in `apache_vhosts` or `nginx_hosts` will be automatically managed. The `vagrant-hostmanager` plugin is also supported. - - You can also have Vagrant automatically assign an available IP address to your VM if you install the `auto_network` plugin (`vagrant plugin install vagrant-auto_network`), and set `vagrant_ip` to `0.0.0.0` inside `config.yml`. + - You can have Vagrant automatically configure your hosts file if you install the `hostsupdater` plugin (`vagrant plugin install vagrant-hostsupdater`). All hosts defined in `apache_vhosts` or `nginx_hosts` will be automatically managed. `vagrant-hostmanager` is also supported. + - The `auto_network` plugin (`vagrant plugin install vagrant-auto_network`) can help with IP address management if you set `vagrant_ip` to `0.0.0.0` inside `config.yml`. 2. Open your browser and access [http://drupalvm.dev/](http://drupalvm.dev/). The default login for the admin account is `admin` for both the username and password. ## Extra software/utilities From 6f28daee2125ebdf186b5368caf44aae7d924e0f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oskar=20Sch=C3=B6ldstr=C3=B6m?= <public@oxy.fi> Date: Mon, 6 Jun 2016 10:47:56 -0400 Subject: [PATCH 0323/1273] Add packagist badge --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 2b7973815..c48f8142b 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ ![Drupal VM Logo](https://raw.githubusercontent.com/geerlingguy/drupal-vm/master/docs/images/drupal-vm-logo.png) -[![Build Status](https://travis-ci.org/geerlingguy/drupal-vm.svg?branch=master)](https://travis-ci.org/geerlingguy/drupal-vm) [![Documentation Status](https://readthedocs.org/projects/drupal-vm/badge/?version=latest)](http://docs.drupalvm.com) +[![Build Status](https://travis-ci.org/geerlingguy/drupal-vm.svg?branch=master)](https://travis-ci.org/geerlingguy/drupal-vm) [![Documentation Status](https://readthedocs.org/projects/drupal-vm/badge/?version=latest)](http://docs.drupalvm.com) [![Packagist](https://img.shields.io/packagist/v/geerlingguy/drupal-vm.svg)](https://packagist.org/packages/geerlingguy/drupal-vm) [Drupal VM](http://www.drupalvm.com/) is A VM for local Drupal development, built with Vagrant + Ansible. From 23f28df3700ba2909cd9e4ba01e90f162f93d282 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oskar=20Sch=C3=B6ldstr=C3=B6m?= <public@oxy.fi> Date: Mon, 6 Jun 2016 11:33:54 -0400 Subject: [PATCH 0324/1273] Issue #704: Expand some topics with more information --- README.md | 2 ++ docs/deployment/drush-make.md | 17 +++++++++++++++-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 2b7973815..54d8c5a02 100644 --- a/README.md +++ b/README.md @@ -83,6 +83,8 @@ Notes: 4. Open Terminal, `cd` to this directory (containing the `Vagrantfile` and this README file). 5. Type in `vagrant up`, and let Vagrant do its magic. +Once the process is complete, you will have a Drupal codebase available inside the `drupal/` directory of the project. + Note: *If there are any errors during the course of running `vagrant up`, and it drops you back to your command prompt, just run `vagrant provision` to continue building the VM from where you left off. If there are still errors after doing this a few times, post an issue to this project's issue queue on GitHub with the error.* ### 3 - Configure your host machine to access the VM. diff --git a/docs/deployment/drush-make.md b/docs/deployment/drush-make.md index 8627661fe..78f0d0289 100644 --- a/docs/deployment/drush-make.md +++ b/docs/deployment/drush-make.md @@ -1,5 +1,18 @@ -Drupal VM is configured to use Composer by default to build a Drupal site on the VM inside `/var/www/drupalvm/drupal` (in a folder that's synced to your local machine, so you can work with the Drupal codebase either locally or inside the VM). +Drupal VM is configured to use Composer by default to build a Drupal site on the VM inside `/var/www/drupalvm/drupal/web` (in a folder that's synced to your local machine, so you can work with the Drupal codebase either locally or inside the VM). -If you want to build a Drupal site using a [Drush make file](http://www.drush.org/en/master/make/) instead, you can either use the `example.drupal.make.yml` file as a base, or use your own Drush make file: just place it or symlink it into the root of the Drupal VM folder with the filename `drupal.make.yml`. You can also set a separate path to the makefile using the `drush_makefile_path` variable. +If you want to build a Drupal site using a [Drush make file](http://www.drush.org/en/master/make/) instead, set `build_composer_project: false`, `build_makefile: true` and either use the `example.drupal.make.yml` file as a base, or use your own Drush make file: just place it or symlink it into the root of the Drupal VM folder with the filename `drupal.make.yml`. You can also set a separate path to the makefile using the `drush_makefile_path` variable. + +```yaml +build_composer_project: false +build_makefile: true +``` Have a look at the defaults in `default.config.yml` and tweak the settings as you'd like in your `config.yml`, then run `vagrant up` as in the Quick Start Guide. Within a few minutes, you should have your site running and available at the `drupal_domain` configured in `config.yml`, falling back to the default `http://drupalvm.dev` set in `default.config.yml`. + +With the default settings the Drupal site will be built on the VM inside `/var/www/drupalvm/drupal/web` but the `web/` subdirectory is only required for `composer` based projects and you can simplify this directory structure by setting `drupal_core_path` to `/var/www/drupalvm/drupal`. + +```yaml +build_composer_project: false +build_makefile: true +drush_core_path: "/var/www/drupalvm/drupal" +``` From e1779d97b9d133a4618d89a042606e94a1386c88 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oskar=20Sch=C3=B6ldstr=C3=B6m?= <public@oxy.fi> Date: Mon, 6 Jun 2016 11:34:44 -0400 Subject: [PATCH 0325/1273] Issue #704: Fix some issues with Composer docs and add acquia/lightning-project as example --- docs/deployment/composer.md | 28 ++++++++++------------------ docs/deployment/local-codebase.md | 2 +- 2 files changed, 11 insertions(+), 19 deletions(-) diff --git a/docs/deployment/composer.md b/docs/deployment/composer.md index e643f57cf..3a53d1d43 100644 --- a/docs/deployment/composer.md +++ b/docs/deployment/composer.md @@ -3,23 +3,23 @@ Drupal VM is configured to use `composer create-project` to build a Drupal 8 cod ## Using composer.json 1. Copy `example.drupal.composer.json` to `drupal.composer.json` and modify it to your liking. -2. Use the Composer build system by setting `build_composer: true` in your `config.yml` (make sure `build_makefile` is set to `false`). +2. Use the Composer build system by setting `build_composer: true` in your `config.yml` (make sure `build_makefile` and `build_composer_project` are set to `false`). 3. Configure `drupal_core_path` to point to the webroot directory: `drupal_core_path: {{ drupal_composer_install_dir }}/docroot` ```yaml -build_makefile: false +build_composer_project: false build_composer: true drupal_core_path: "{{ drupal_composer_install_dir }}/docroot" ``` -_The file set in `drupal_composer_path` (which defaults to `drupal.composer.json`) will be copied from your host computer into the VM's `drupal_composer_install_dir` and renamed `composer.json`. If you already have a composer.json within that directory, you can set `drupal_composer_path: false`._ +_The file set in `drupal_composer_path` (which defaults to `drupal.composer.json`) will be copied from your host computer into the VM's `drupal_composer_install_dir` and renamed `composer.json`. If you already have a composer.json within that directory, set `drupal_composer_path: false`._ ## Using Composer when [Drupal VM is a composer dependency itself](../other/drupalvm-composer-dependency.md) -In the scenario where you already have an existing `composer.json` in the root of your project, follow the usual steps for installing with a composer.json but instead of creating a `drupal.composer.json` file, disable the transfering of the file by setting `drupal_composer_path` to `false`, and change `drupal_composer_install_dir` to point to the the directory where it will be located. If `drupal_composer_path` is not truthy, Drupal VM assumes it already exists. +In the scenario where you already have an existing `composer.json` in the root of your project, follow the usual steps for installing with a composer.json but instead of creating a `drupal.composer.json` file, disable the transfering of the file by setting `drupal_composer_path: false`, and change `drupal_composer_install_dir` to point to the the directory where it will be located. If `drupal_composer_path` is not truthy, Drupal VM assumes it already exists. ```yaml -build_makefile: false +build_composer_project: false build_composer: true drupal_composer_path: false drupal_composer_install_dir: "/var/www/drupalvm" @@ -33,22 +33,14 @@ This is the default Drupal VM build configuration, set up by the following setti - Composer will build the project if `build_composer_project` is `true`, and `build_makefile` and `build_composer` are both `false`. - The Composer package is defined by `drupal_composer_project_package`. - Adjust the create-project CLI options in `drupal_composer_project_options` as well as add additional dependencies in `drupal_composer_dependencies`. - - Ensure that the webroot configured in the Composer package matches the one set in `drupal_core_path`. + - Ensure that the webroot configured in the Composer package matches the one set in `drupal_core_path`. The default is set to `web/`. -With [drupal-composer/drupal-project](https://github.com/drupal-composer/drupal-project) as an example your `config.yml` settings would be: +With [acquia/lightning-project](https://github.com/acquia/lightning-project) as an example your `config.yml` settings would be: ```yaml -build_makefile: false -build_composer: false -build_composer_project: true - -drupal_composer_project_package: "drupal-composer/drupal-project:8.x-dev" -# Added `--no-dev` to avoid installing development dependencies. -drupal_composer_project_options: "--prefer-dist --stability dev --no-interaction --no-dev" -drupal_composer_dependencies: - - "drupal/devel:8.*" - -drupal_core_path: "{{ drupal_composer_install_dir }}/web" +drupal_composer_project_package: "acquia/lightning-project:^8.1.0" +drupal_composer_project_options: "--prefer-dist --stability rc --no-interaction" +drupal_core_path: "{{ drupal_composer_install_dir }}/docroot" ``` ## Improving composer build performance diff --git a/docs/deployment/local-codebase.md b/docs/deployment/local-codebase.md index 97ecf34b9..63fac15a3 100644 --- a/docs/deployment/local-codebase.md +++ b/docs/deployment/local-codebase.md @@ -18,7 +18,7 @@ Set all the `build_` variables and `install_site` to `false`: ```yaml build_makefile: false build_composer: false -build_composer_project: true +build_composer_project: false ... install_site: false ``` From 913be94c1b5f1e1ad643efd454561ae7768fbb32 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oskar=20Sch=C3=B6ldstr=C3=B6m?= <public@oxy.fi> Date: Mon, 6 Jun 2016 11:35:44 -0400 Subject: [PATCH 0326/1273] Issue #704: Take root composer.json into account in docs on Drupal VM as a dependency --- docs/other/drupalvm-composer-dependency.md | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/docs/other/drupalvm-composer-dependency.md b/docs/other/drupalvm-composer-dependency.md index e6d58c64f..5d143470e 100644 --- a/docs/other/drupalvm-composer-dependency.md +++ b/docs/other/drupalvm-composer-dependency.md @@ -15,9 +15,9 @@ Add and configure the `config.yml` anywhere you like, in this example we place i _Note: This will be the directory where Drupal VM looks for other local configuration files as well. Such as [`local.config.yml` and `Vagrantfile.local`](overriding-configurations.md)._ ``` +├── composer.json ├── config/ │ ├── config.yml -│ ├── drupal.make.yml │ ├── local.config.yml │ └── Vagrantfile.local ├── docroot/ @@ -29,6 +29,16 @@ _Note: This will be the directory where Drupal VM looks for other local configur └── drupal-vm/ ``` +Change the build strategy to use your `composer.json` file by setting: + +```yaml +build_composer_project: false +build_composer: true +drupal_composer_path: false +drupal_composer_install_dir: "/var/www/drupalvm" +drupal_core_path: "{{ drupal_composer_install_dir }}/docroot" +``` + If you're using `pre_provision_scripts` or `post_provision_scripts` you also need to adjust their paths to take into account the new directory structure. The examples used in `default.config.yml` assume the files are located in the Drupal VM directory. If you use relative paths you need to the ascend the directory tree as far as the project root, but using the `config_dir` variable you get the absolute path of where you `config.yml` is located. ```yaml @@ -66,7 +76,6 @@ Your project structure should now look like this: ├── composer.json ├── config/ │ ├── config.yml -│ ├── drupal.make.yml │ ├── local.config.yml │ └── Vagrantfile.local ├── docroot/ @@ -117,7 +126,6 @@ Your directory structure should now look like this: ``` ├── Vagrantfile ├── config/ -│ ├── drupal.make.yml │ ├── config.yml │ ├── local.config.yml │ └── Vagrantfile.local From 7049d4ee761e07f7210a25228248c662c6907b46 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oskar=20Sch=C3=B6ldstr=C3=B6m?= <public@oxy.fi> Date: Mon, 6 Jun 2016 14:11:49 -0400 Subject: [PATCH 0327/1273] Use packages.drupal.org composer repository in example --- example.drupal.composer.json | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/example.drupal.composer.json b/example.drupal.composer.json index 528047ef7..451d63dd9 100644 --- a/example.drupal.composer.json +++ b/example.drupal.composer.json @@ -12,7 +12,7 @@ "repositories": [ { "type": "composer", - "url": "https://packagist.drupal-composer.org" + "url": "https://packages.drupal.org/8" } ], "require": { @@ -21,6 +21,9 @@ "drupal/core": "~8.0", "drupal/devel": "8.*" }, + "replace": { + "drupal/drupal": "*" + }, "minimum-stability": "dev", "prefer-stable": true, "extra": { From 37536adf5865caec7b21b2a36a77f45937a38698 Mon Sep 17 00:00:00 2001 From: Jeff Geerling <geerlingguy@mac.com> Date: Mon, 6 Jun 2016 17:00:06 -0500 Subject: [PATCH 0328/1273] Update Node.js role dependency to 3.1.0. --- provisioning/requirements.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/provisioning/requirements.yml b/provisioning/requirements.yml index c4b47fe03..3d5543a5c 100644 --- a/provisioning/requirements.yml +++ b/provisioning/requirements.yml @@ -34,7 +34,7 @@ - src: geerlingguy.nginx version: 1.9.2 - src: geerlingguy.nodejs - version: 3.0.0 + version: 3.1.0 - src: geerlingguy.php version: 3.1.0 - src: geerlingguy.php-memcached From f4c4390e1e4e21dbf75b4e5b011f30426e37f972 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oskar=20Sch=C3=B6ldstr=C3=B6m?= <public@oxy.fi> Date: Mon, 6 Jun 2016 18:27:03 -0400 Subject: [PATCH 0329/1273] Issue #709: Add strict vagrant version requirement for easier debugging --- Vagrantfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Vagrantfile b/Vagrantfile index 432ab2bc1..5e643b8ca 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -1,6 +1,7 @@ # -*- mode: ruby -*- # vi: set ft=ruby : VAGRANTFILE_API_VERSION = '2' +Vagrant.require_version '>= 1.8.1' # Absolute paths on the host machine. host_drupalvm_dir = File.dirname(File.expand_path(__FILE__)) From b71252a87c2ef47dfca8ed8848d575673463fe15 Mon Sep 17 00:00:00 2001 From: Thom Toogood <thomtoogood@gmail.com> Date: Thu, 9 Jun 2016 22:34:49 +1000 Subject: [PATCH 0330/1273] Set node global install directory to a location writable by the vagrant user. --- default.config.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/default.config.yml b/default.config.yml index 759c2f573..45a3b8369 100644 --- a/default.config.yml +++ b/default.config.yml @@ -244,6 +244,9 @@ composer_home_group: "{{ drupalvm_user }}" composer_global_packages: - { name: hirak/prestissimo, release: '^0.3' } +# NodeJS Configuration. +npm_config_prefix: "~/.npm-global" + # Run specified scripts before or after VM is provisioned. Path is relative to # the `provisioning/playbook.yml` file. pre_provision_scripts: [] From 1a346c5e208f9b0effe474e53e3400a21a98f986 Mon Sep 17 00:00:00 2001 From: Jeff Geerling <geerlingguy@mac.com> Date: Thu, 9 Jun 2016 14:35:03 -0500 Subject: [PATCH 0331/1273] Update to latest PHP role version. --- provisioning/requirements.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/provisioning/requirements.yml b/provisioning/requirements.yml index 3d5543a5c..aefd3e827 100644 --- a/provisioning/requirements.yml +++ b/provisioning/requirements.yml @@ -36,7 +36,7 @@ - src: geerlingguy.nodejs version: 3.1.0 - src: geerlingguy.php - version: 3.1.0 + version: 3.2.0 - src: geerlingguy.php-memcached version: 2.0.0 - src: geerlingguy.php-mysql From eb45fc85392ceedced6ab77f58e7e7c85fd590b9 Mon Sep 17 00:00:00 2001 From: Jeff Geerling <geerlingguy@mac.com> Date: Thu, 9 Jun 2016 15:57:36 -0500 Subject: [PATCH 0332/1273] PR #715 follow-up: Reorder vars in default.config.yml. --- default.config.yml | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/default.config.yml b/default.config.yml index 45a3b8369..0a5c65ad7 100644 --- a/default.config.yml +++ b/default.config.yml @@ -188,16 +188,6 @@ installed_extras: extra_packages: - sqlite -# `nodejs` must be in installed_extras for this to work. Valid examples: "0.10", -# "0.12", "4.x", "5.x". -nodejs_version: "0.12" -nodejs_npm_global_packages: [] -nodejs_install_npm_user: "{{ drupalvm_user }}" - -# `ruby` must be in installed_extras for this to work. -ruby_install_gems_user: "{{ drupalvm_user }}" -ruby_install_gems: [] - # You can configure almost anything else on the server in the rest of this file. extra_security_enabled: false @@ -244,9 +234,6 @@ composer_home_group: "{{ drupalvm_user }}" composer_global_packages: - { name: hirak/prestissimo, release: '^0.3' } -# NodeJS Configuration. -npm_config_prefix: "~/.npm-global" - # Run specified scripts before or after VM is provisioned. Path is relative to # the `provisioning/playbook.yml` file. pre_provision_scripts: [] @@ -260,7 +247,18 @@ mysql_slow_query_time: 2 mysql_wait_timeout: 300 adminer_install_filename: index.php -# Varnish Configuration. +# Node.js configuration (if enabled above). +# Valid examples: "0.10", "0.12", "4.x", "5.x". +nodejs_version: "0.12" +nodejs_npm_global_packages: [] +nodejs_install_npm_user: "{{ drupalvm_user }}" +npm_config_prefix: "~/.npm-global" + +# Ruby Configuration (if enabled above). +ruby_install_gems_user: "{{ drupalvm_user }}" +ruby_install_gems: [] + +# Varnish Configuration (if enabled above). varnish_listen_port: "81" varnish_default_vcl_template_path: templates/drupalvm.vcl.j2 varnish_default_backend_host: "127.0.0.1" From 7e6781552777bc0a33138579fbc426ce143b4813 Mon Sep 17 00:00:00 2001 From: Jeff Geerling <geerlingguy@mac.com> Date: Thu, 9 Jun 2016 16:04:42 -0500 Subject: [PATCH 0333/1273] Bump Node.js role version to latest. --- provisioning/requirements.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/provisioning/requirements.yml b/provisioning/requirements.yml index aefd3e827..e1e2c048a 100644 --- a/provisioning/requirements.yml +++ b/provisioning/requirements.yml @@ -34,7 +34,7 @@ - src: geerlingguy.nginx version: 1.9.2 - src: geerlingguy.nodejs - version: 3.1.0 + version: 3.2.0 - src: geerlingguy.php version: 3.2.0 - src: geerlingguy.php-memcached From b0f3cef98d8cf361ef03291600c906bdbb8f7767 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oskar=20Sch=C3=B6ldstr=C3=B6m?= <public@oxy.fi> Date: Fri, 10 Jun 2016 14:14:09 -0400 Subject: [PATCH 0334/1273] Add www.drupalvm.dev as a default webserver alias --- default.config.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/default.config.yml b/default.config.yml index 0a5c65ad7..175241265 100644 --- a/default.config.yml +++ b/default.config.yml @@ -92,6 +92,7 @@ configure_drush_aliases: true # View the geerlingguy.apache Ansible Role README for more options. apache_vhosts: - servername: "{{ drupal_domain }}" + serveralias: "www.{{ drupal_domain }}" documentroot: "{{ drupal_core_path }}" extra_parameters: | ProxyPassMatch ^/(.*\.php(/.*)?)$ "fcgi://127.0.0.1:9000{{ drupal_core_path }}" @@ -130,7 +131,7 @@ apache_mods_enabled: # here. Set the 'is_php' property for document roots that contain PHP apps like # Drupal. nginx_hosts: - - server_name: "{{ drupal_domain }}" + - server_name: "{{ drupal_domain }} www.{{ drupal_domain }}" root: "{{ drupal_core_path }}" is_php: true From 460e40c401cf177dc5f69adc71a29c3a8b4bef01 Mon Sep 17 00:00:00 2001 From: Dan Bohea <git@bohea.co.uk> Date: Fri, 10 Jun 2016 22:00:58 +0100 Subject: [PATCH 0335/1273] Clearer comments: required vars in default.config sounded optional - See #723 --- default.config.yml | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/default.config.yml b/default.config.yml index 0a5c65ad7..1d7e8c036 100644 --- a/default.config.yml +++ b/default.config.yml @@ -58,18 +58,20 @@ drupal_composer_project_options: "--prefer-dist --stability dev --no-interaction # settings below), but instead copy down a database (e.g. using drush sql-sync). install_site: true -# Settings for installing a Drupal site (if 'install_site:' is 'true'). -drupal_major_version: 8 +# Required Drupal settings. drupal_core_path: "{{ drupal_composer_install_dir }}/web" +drupal_mysql_user: drupal +drupal_mysql_password: drupal +drupal_mysql_database: drupal + +# Settings for installing a Drupal site if 'install_site:' is 'true'. +drupal_major_version: 8 drupal_domain: "{{ vagrant_hostname }}" drupal_site_name: "Drupal" drupal_install_profile: standard drupal_enable_modules: [ 'devel' ] drupal_account_name: admin drupal_account_pass: admin -drupal_mysql_user: drupal -drupal_mysql_password: drupal -drupal_mysql_database: drupal # Additional arguments or options to pass to `drush site-install`. drupal_site_install_extra_args: [] From d3cb7f68e6c9b6532416b8e5cbd84d22cf5150fa Mon Sep 17 00:00:00 2001 From: Jeff Geerling <geerlingguy@mac.com> Date: Fri, 10 Jun 2016 21:11:35 -0500 Subject: [PATCH 0336/1273] Bump PHP role version to latest bugfix release. --- provisioning/requirements.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/provisioning/requirements.yml b/provisioning/requirements.yml index e1e2c048a..a47bafe95 100644 --- a/provisioning/requirements.yml +++ b/provisioning/requirements.yml @@ -36,7 +36,7 @@ - src: geerlingguy.nodejs version: 3.2.0 - src: geerlingguy.php - version: 3.2.0 + version: 3.2.1 - src: geerlingguy.php-memcached version: 2.0.0 - src: geerlingguy.php-mysql From ab5d8356345aaf8f24da9221dcf6668d0abf6003 Mon Sep 17 00:00:00 2001 From: Jeff Geerling <geerlingguy@mac.com> Date: Sun, 12 Jun 2016 16:48:21 -0500 Subject: [PATCH 0337/1273] Bump MySQL role version to latest. --- provisioning/requirements.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/provisioning/requirements.yml b/provisioning/requirements.yml index a47bafe95..d55076737 100644 --- a/provisioning/requirements.yml +++ b/provisioning/requirements.yml @@ -30,7 +30,7 @@ - src: geerlingguy.memcached version: 1.0.4 - src: geerlingguy.mysql - version: 2.2.1 + version: 2.2.2 - src: geerlingguy.nginx version: 1.9.2 - src: geerlingguy.nodejs From 9cfe62ca1863aefc9f8f4ba21bbb197813b2acb0 Mon Sep 17 00:00:00 2001 From: Thom Toogood <thomtoogood@gmail.com> Date: Wed, 1 Jun 2016 07:44:43 +1000 Subject: [PATCH 0338/1273] Add ssh_home var as default pwd for SSH. --- default.config.yml | 1 + provisioning/tasks/sshd.yml | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/default.config.yml b/default.config.yml index 3681e7b38..05269d7a1 100644 --- a/default.config.yml +++ b/default.config.yml @@ -292,3 +292,4 @@ selenium_version: 2.46.0 # Other configuration. dashboard_install_dir: /var/www/dashboard known_hosts_path: ~/.ssh/known_hosts +#ssh_home: "{{ drupal_core_path }}" diff --git a/provisioning/tasks/sshd.yml b/provisioning/tasks/sshd.yml index be492d667..2006c2f59 100644 --- a/provisioning/tasks/sshd.yml +++ b/provisioning/tasks/sshd.yml @@ -19,3 +19,13 @@ mode: 0644 become: no when: known_hosts_file.stat.exists + +- name: Set SSH home directory. + lineinfile: + dest: "/home/{{ drupalvm_user }}/.bashrc" + state: present + create: yes + regexp: "^SSH_HOME=" + line: "SSH_HOME={{ ssh_home }} && [ -e $SSH_HOME ] && cd $SSH_HOME" + become: no + when: ssh_home is defined From 4ffd60d8b06af6cefd6acee4f4f893385eb6a374 Mon Sep 17 00:00:00 2001 From: Jeff Geerling <geerlingguy@mac.com> Date: Sun, 12 Jun 2016 22:19:34 -0500 Subject: [PATCH 0339/1273] Fixes #726: Ensure correct permissions when using Composer create-project. --- provisioning/tasks/build-composer-project.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/provisioning/tasks/build-composer-project.yml b/provisioning/tasks/build-composer-project.yml index 9964be1ff..17cda31f6 100644 --- a/provisioning/tasks/build-composer-project.yml +++ b/provisioning/tasks/build-composer-project.yml @@ -1,4 +1,13 @@ --- +- name: Ensure drupal_composer_install_dir directory has proper permissions. + file: + path: "{{ drupal_composer_install_dir }}" + state: directory + owner: "{{ drupalvm_user }}" + group: "{{ drupalvm_user }}" + mode: 0775 + when: not drupal_site_exists + - name: Generate Drupal project with composer package. command: > {{ composer_path }} create-project From 6cc1f733507462b9497203016c27b91f8d6cf764 Mon Sep 17 00:00:00 2001 From: Jeff Geerling <geerlingguy@mac.com> Date: Sun, 12 Jun 2016 22:50:19 -0500 Subject: [PATCH 0340/1273] Fixes #650: Bump MySQL role version to fix root user account password. --- provisioning/requirements.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/provisioning/requirements.yml b/provisioning/requirements.yml index d55076737..49d632580 100644 --- a/provisioning/requirements.yml +++ b/provisioning/requirements.yml @@ -30,7 +30,7 @@ - src: geerlingguy.memcached version: 1.0.4 - src: geerlingguy.mysql - version: 2.2.2 + version: 2.2.3 - src: geerlingguy.nginx version: 1.9.2 - src: geerlingguy.nodejs From 01431ac449e55f82bb4b22768c9d780efd304491 Mon Sep 17 00:00:00 2001 From: Joe Bartlett <joe.bartlett@vml.com> Date: Mon, 13 Jun 2016 10:58:10 -0500 Subject: [PATCH 0341/1273] Renewed from PR#721 - fixes zero (0.0.0.0) IP issue in dashboard template --- provisioning/templates/dashboard.html.j2 | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/provisioning/templates/dashboard.html.j2 b/provisioning/templates/dashboard.html.j2 index db8e0894a..99eaf6e17 100644 --- a/provisioning/templates/dashboard.html.j2 +++ b/provisioning/templates/dashboard.html.j2 @@ -19,6 +19,10 @@ </style> </head> <body> + {# 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' -%} From d95227588767c11863aeb7c7a1a1d4599011c2d7 Mon Sep 17 00:00:00 2001 From: Jeff Geerling <geerlingguy@mac.com> Date: Mon, 13 Jun 2016 17:18:29 -0500 Subject: [PATCH 0342/1273] Issue #733: Update example composer.json to work with drupal.org packagist devel version. --- example.drupal.composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/example.drupal.composer.json b/example.drupal.composer.json index 451d63dd9..4bea7ebaa 100644 --- a/example.drupal.composer.json +++ b/example.drupal.composer.json @@ -19,7 +19,7 @@ "composer/installers": "^1.0.20", "drupal-composer/drupal-scaffold": "^2.0.1", "drupal/core": "~8.0", - "drupal/devel": "8.*" + "drupal/devel": "1.0.x-dev" }, "replace": { "drupal/drupal": "*" From b0f22726fdad529a62d00ceafa26c67e6eae019c Mon Sep 17 00:00:00 2001 From: Jeff Geerling <geerlingguy@mac.com> Date: Mon, 13 Jun 2016 17:22:20 -0500 Subject: [PATCH 0343/1273] Issue #733: Fix variable name in makefile docs. --- docs/deployment/drush-make.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/deployment/drush-make.md b/docs/deployment/drush-make.md index 78f0d0289..7a167c17f 100644 --- a/docs/deployment/drush-make.md +++ b/docs/deployment/drush-make.md @@ -14,5 +14,5 @@ With the default settings the Drupal site will be built on the VM inside `/var/w ```yaml build_composer_project: false build_makefile: true -drush_core_path: "/var/www/drupalvm/drupal" +drupal_core_path: "/var/www/drupalvm/drupal" ``` From c6b64593f2b3f7efa6070f1039c28ac15da6a6f3 Mon Sep 17 00:00:00 2001 From: Jeff Geerling <geerlingguy@mac.com> Date: Tue, 14 Jun 2016 13:04:32 -0500 Subject: [PATCH 0344/1273] Revert #726 Fix 2, Fixes #727. --- provisioning/tasks/build-composer-project.yml | 9 --------- 1 file changed, 9 deletions(-) diff --git a/provisioning/tasks/build-composer-project.yml b/provisioning/tasks/build-composer-project.yml index 17cda31f6..9964be1ff 100644 --- a/provisioning/tasks/build-composer-project.yml +++ b/provisioning/tasks/build-composer-project.yml @@ -1,13 +1,4 @@ --- -- name: Ensure drupal_composer_install_dir directory has proper permissions. - file: - path: "{{ drupal_composer_install_dir }}" - state: directory - owner: "{{ drupalvm_user }}" - group: "{{ drupalvm_user }}" - mode: 0775 - when: not drupal_site_exists - - name: Generate Drupal project with composer package. command: > {{ composer_path }} create-project From d450252919b6c4c1847def347cfb7a979244bfb8 Mon Sep 17 00:00:00 2001 From: Jeff Geerling <geerlingguy@mac.com> Date: Tue, 14 Jun 2016 13:36:19 -0500 Subject: [PATCH 0345/1273] Fixes #736: Windows and vagrant-cachier NFS hardcoding conflict. --- Vagrantfile | 5 ----- 1 file changed, 5 deletions(-) diff --git a/Vagrantfile b/Vagrantfile index 5e643b8ca..04ee296b6 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -183,11 +183,6 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| config.cache.enable :apt # Cache the composer directory. config.cache.enable :generic, cache_dir: '/home/vagrant/.composer/cache' - # Cache via NFS shares. - config.cache.synced_folder_opts = { - type: :nfs, - mount_options: ['rw', 'vers=3', 'tcp', 'nolock'] - } end # Allow an untracked Vagrantfile to modify the configurations From f16f8b548725c8890c612efafbc8d0194ad3334d Mon Sep 17 00:00:00 2001 From: Jeff Geerling <geerlingguy@mac.com> Date: Tue, 14 Jun 2016 16:35:45 -0500 Subject: [PATCH 0346/1273] Bump Ansible composer role requirement. --- provisioning/requirements.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/provisioning/requirements.yml b/provisioning/requirements.yml index 49d632580..88f7c2358 100644 --- a/provisioning/requirements.yml +++ b/provisioning/requirements.yml @@ -12,7 +12,7 @@ - src: geerlingguy.blackfire version: 1.0.0 - src: geerlingguy.composer - version: 1.4.0 + version: 1.4.1 - src: geerlingguy.daemonize version: 1.1.0 - src: geerlingguy.drupal-console From fdd347e6b27e3f754d131722959a5eca85317a46 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oskar=20Sch=C3=B6ldstr=C3=B6m?= <public@oxy.fi> Date: Wed, 15 Jun 2016 08:01:33 -0400 Subject: [PATCH 0347/1273] Issue #734: Fix Vagrant 1.8.4 failing to mount NFS synced folders with empty mount_options --- Vagrantfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Vagrantfile b/Vagrantfile index 5e643b8ca..56690baf3 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -107,7 +107,7 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| rsync__args: ['--verbose', '--archive', '--delete', '-z', '--chmod=ugo=rwX'], id: synced_folder['id'], create: synced_folder.include?('create') ? synced_folder['create'] : false, - mount_options: synced_folder.include?('mount_options') ? synced_folder['mount_options'] : [] + mount_options: synced_folder.include?('mount_options') ? synced_folder['mount_options'] : nil } if synced_folder.include?('options_override') options = options.merge(synced_folder['options_override']) From 1bff8189a6d66f40497c8afa2a6bfa04fa540d78 Mon Sep 17 00:00:00 2001 From: Jeff Geerling <geerlingguy@mac.com> Date: Thu, 16 Jun 2016 14:52:28 -0500 Subject: [PATCH 0348/1273] Issue #733: Copy and move composer.json file so Windows composer install works. --- provisioning/tasks/build-composer.yml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/provisioning/tasks/build-composer.yml b/provisioning/tasks/build-composer.yml index 7602a3a7c..b99b7a679 100644 --- a/provisioning/tasks/build-composer.yml +++ b/provisioning/tasks/build-composer.yml @@ -7,10 +7,17 @@ become: no when: drupal_composer_path and not drupal_site_exists -- name: Copy composer.json into place. +# Use copy-and-move to prevent issues in Windows with VirtualBox. See: +# https://github.com/ansible/ansible/issues/9526#issuecomment-62336962 +- name: Copy composer.json into temporary location. copy: src: "{{ drupal_composer_path }}" - dest: "{{ drupal_composer_install_dir }}/composer.json" + dest: "/tmp/drupalvm-composer.json" + when: drupal_composer_path and not drupal_site_exists + become: no + +- name: Move composer.json into place. + command: "mv /tmp/drupalvm-composer.json {{ drupal_composer_install_dir }}/composer.json" when: drupal_composer_path and not drupal_site_exists become: no From 407b94c7c9a09c3ea740e456abb0fa4f0e82ec18 Mon Sep 17 00:00:00 2001 From: Jeff Geerling <geerlingguy@mac.com> Date: Thu, 16 Jun 2016 16:12:12 -0500 Subject: [PATCH 0349/1273] Issue #733: Fix Drupal composer project build to work on slow Windows mounts. --- example.drupal.composer.json | 3 +++ provisioning/tasks/build-composer-project.yml | 2 ++ 2 files changed, 5 insertions(+) diff --git a/example.drupal.composer.json b/example.drupal.composer.json index 4bea7ebaa..02eb9386d 100644 --- a/example.drupal.composer.json +++ b/example.drupal.composer.json @@ -34,5 +34,8 @@ "docroot/themes/contrib/{$name}": ["type:drupal-theme"], "drush/contrib/{$name}": ["type:drupal-drush"] } + }, + "config": { + "process-timeout": 1200 } } diff --git a/provisioning/tasks/build-composer-project.yml b/provisioning/tasks/build-composer-project.yml index 9964be1ff..9372c81f9 100644 --- a/provisioning/tasks/build-composer-project.yml +++ b/provisioning/tasks/build-composer-project.yml @@ -6,6 +6,8 @@ {{ drupal_composer_project_options|default('--prefer-dist --no-interaction') }} when: not drupal_site_exists become: no + environment: + COMPOSER_PROCESS_TIMEOUT: 1200 - name: Install dependencies with composer require. command: > From c5ba5f8a2067b54e3e650545281a8eb097ea0efd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oskar=20Sch=C3=B6ldstr=C3=B6m?= <public@oxy.fi> Date: Fri, 17 Jun 2016 15:21:52 -0400 Subject: [PATCH 0350/1273] Issue #744: Fix npm_config_prefix directory created under root instead of vagrant --- default.config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/default.config.yml b/default.config.yml index 05269d7a1..58c3eac14 100644 --- a/default.config.yml +++ b/default.config.yml @@ -255,7 +255,7 @@ adminer_install_filename: index.php nodejs_version: "0.12" nodejs_npm_global_packages: [] nodejs_install_npm_user: "{{ drupalvm_user }}" -npm_config_prefix: "~/.npm-global" +npm_config_prefix: "/home/{{ drupalvm_user }}/.npm-global" # Ruby Configuration (if enabled above). ruby_install_gems_user: "{{ drupalvm_user }}" From 1701f14cf1d28e1e976352c4f6cdaf05eccf6a35 Mon Sep 17 00:00:00 2001 From: Jeff Geerling <geerlingguy@mac.com> Date: Wed, 22 Jun 2016 00:00:04 -0500 Subject: [PATCH 0351/1273] The macOS-ification of the brand. --- README.md | 2 +- docs/extras/mysql.md | 2 +- docs/other/windows.md | 2 +- provisioning/JJG-Ansible-Windows/README.md | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 90eaa4e84..dbbcf0977 100644 --- a/README.md +++ b/README.md @@ -71,7 +71,7 @@ Vagrant will automatically install [VirtualBox](https://www.virtualbox.org/wiki/ Notes: - - **For faster provisioning** (Mac/Linux only): *[Install Ansible](http://docs.ansible.com/intro_installation.html) on your host machine, so Drupal VM can run the provisioning steps locally instead of inside the VM.* + - **For faster provisioning** (macOS/Linux only): *[Install Ansible](http://docs.ansible.com/intro_installation.html) on your host machine, so Drupal VM can run the provisioning steps locally instead of inside the VM.* - **NFS on Linux**: *If NFS is not already installed on your host, you will need to install it to use the default NFS synced folder configuration. See guides for [Debian/Ubuntu](https://www.digitalocean.com/community/tutorials/how-to-set-up-an-nfs-mount-on-ubuntu-14-04), [Arch](https://wiki.archlinux.org/index.php/NFS#Installation), and [RHEL/CentOS](https://www.digitalocean.com/community/tutorials/how-to-set-up-an-nfs-mount-on-centos-6).* - **Versions**: *Make sure you're running the latest releases of Vagrant, VirtualBox, and Ansible—as of February 2016, Drupal VM recommends: Vagrant 1.8.1, VirtualBox 5.0.20, and Ansible 2.1.0.* diff --git a/docs/extras/mysql.md b/docs/extras/mysql.md index 4a18ed96b..c461cf5f0 100644 --- a/docs/extras/mysql.md +++ b/docs/extras/mysql.md @@ -1,4 +1,4 @@ -By default, this VM is set up so you can manage MySQL databases on your own. The default root MySQL user credentials are `root` for username and password, but you can change the password via `config.yml` (changing the `mysql_root_password` variable). I use [Sequel Pro](http://www.sequelpro.com/) (Mac-only) to connect to and manage databases, and Drush to sync databases (sometimes I'll just do a dump and import, but Drush is usually quicker, and is easier to do over and over again when you need it). +By default, this VM is set up so you can manage MySQL databases on your own. The default root MySQL user credentials are `root` for username and password, but you can change the password via `config.yml` (changing the `mysql_root_password` variable). I use [Sequel Pro](http://www.sequelpro.com/) (macOS-only) to connect to and manage databases, and Drush to sync databases (sometimes I'll just do a dump and import, but Drush is usually quicker, and is easier to do over and over again when you need it). ## Connect using Adminer diff --git a/docs/other/windows.md b/docs/other/windows.md index 25d1cb851..b3866d2ca 100644 --- a/docs/other/windows.md +++ b/docs/other/windows.md @@ -72,7 +72,7 @@ If you are running Windows 7 and `vagrant up` hangs, you may need to upgrade Pow ## Hosts file updates -If you install either the `vagrant-hostsupdater` or `vagrant-hostmanager` plugin, you might get a permissions error when Vagrant tries changing the hosts file. On a Mac or Linux workstation, you're prompted for a sudo password so the change can be made, but on Windows, you have to do one of the following to make sure hostsupdater works correctly: +If you install either the `vagrant-hostsupdater` or `vagrant-hostmanager` plugin, you might get a permissions error when Vagrant tries changing the hosts file. On a macOS or Linux workstation, you're prompted for a sudo password so the change can be made, but on Windows, you have to do one of the following to make sure hostsupdater works correctly: 1. Run PowerShell or whatever CLI you use with Vagrant as an administrator. Right click on the application and select 'Run as administrator', then proceed with `vagrant` commands as normal. 2. Change the permissions on the hosts file so your account has permission to edit the file (this has security implications, so it's best to use option 1 unless you know what you're doing). To do this, open `%SystemRoot%\system32\drivers\etc` in Windows Explorer, right-click the `hosts` file, and under Security, add your account and give yourself full access to the file. diff --git a/provisioning/JJG-Ansible-Windows/README.md b/provisioning/JJG-Ansible-Windows/README.md index e7548efaf..48097c6ec 100644 --- a/provisioning/JJG-Ansible-Windows/README.md +++ b/provisioning/JJG-Ansible-Windows/README.md @@ -23,7 +23,7 @@ if is_windows sh.args = "/vagrant/provisioning/playbook.yml" end else - # Provisioning configuration for Ansible (for Mac/Linux hosts). + # Provisioning configuration for Ansible (for macOS/Linux hosts). config.vm.provision "ansible" do |ansible| ansible.playbook = "provisioning/playbook.yml" ansible.sudo = true From aeeb79aa5a92968e33344849fd52626d4c976bf1 Mon Sep 17 00:00:00 2001 From: Joe Stewart <joe.stewart@mediacurrent.com> Date: Mon, 27 Jun 2016 10:46:28 -0500 Subject: [PATCH 0352/1273] Support including extra_parameters for nginx vhosts --- provisioning/templates/nginx-vhost.conf.j2 | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/provisioning/templates/nginx-vhost.conf.j2 b/provisioning/templates/nginx-vhost.conf.j2 index 7f37bc349..44f84bd58 100644 --- a/provisioning/templates/nginx-vhost.conf.j2 +++ b/provisioning/templates/nginx-vhost.conf.j2 @@ -90,4 +90,8 @@ server { image/x-icon; gzip_buffers 16 8k; gzip_min_length 512; + +{% if item.extra_parameters is defined %} + {{ item.extra_parameters }} +{% endif %} } From 70af9066986dd37a9a928e05165fdb458515f1b9 Mon Sep 17 00:00:00 2001 From: Eric Steinborn <esteinborn@gmail.com> Date: Tue, 28 Jun 2016 13:34:26 -0400 Subject: [PATCH 0353/1273] DOCS: Set vagrant_box to ubuntu1404 for PHP 5.6 fixes #765 --- docs/other/php-56.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/other/php-56.md b/docs/other/php-56.md index 4fecd645f..cd1ff558a 100644 --- a/docs/other/php-56.md +++ b/docs/other/php-56.md @@ -11,6 +11,7 @@ Ubuntu 16.04 Xenial defaults to PHP 7.0 in it's system packages. No older versio Ondřej Surý's PPA for PHP 7.0 is used to install PHP 7, but you can switch to using different 5.6 packages instead by making the following changes to `config.yml`: ```yaml +vagrant_box: geerlingguy/ubuntu1404 php_version: "5.6" php_packages: - php5 From 1a82cc306693a61d74be03bf3fe88fab000e0acf Mon Sep 17 00:00:00 2001 From: Jeff Geerling <geerlingguy@mac.com> Date: Wed, 29 Jun 2016 11:20:15 -0500 Subject: [PATCH 0354/1273] Issue #726, #720, #727: Fix permissions on the synced folder for composer project build. --- provisioning/tasks/build-composer-project.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/provisioning/tasks/build-composer-project.yml b/provisioning/tasks/build-composer-project.yml index 9372c81f9..fedb49013 100644 --- a/provisioning/tasks/build-composer-project.yml +++ b/provisioning/tasks/build-composer-project.yml @@ -1,4 +1,14 @@ --- +- name: Ensure drupal_composer_install_dir directory has proper permissions. + file: + path: "{{ drupal_composer_install_dir }}" + state: directory + owner: "{{ drupalvm_user }}" + group: "{{ drupalvm_user }}" + mode: 0775 + when: not drupal_site_exists + failed_when: false + - name: Generate Drupal project with composer package. command: > {{ composer_path }} create-project From fb40e2083cee353457e29ef9f43cbe63b30a6704 Mon Sep 17 00:00:00 2001 From: Jeff Geerling <geerlingguy@mac.com> Date: Thu, 30 Jun 2016 09:02:04 -0500 Subject: [PATCH 0355/1273] Bump recommended dependency versions. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index dbbcf0977..47575c5e0 100644 --- a/README.md +++ b/README.md @@ -73,7 +73,7 @@ Notes: - **For faster provisioning** (macOS/Linux only): *[Install Ansible](http://docs.ansible.com/intro_installation.html) on your host machine, so Drupal VM can run the provisioning steps locally instead of inside the VM.* - **NFS on Linux**: *If NFS is not already installed on your host, you will need to install it to use the default NFS synced folder configuration. See guides for [Debian/Ubuntu](https://www.digitalocean.com/community/tutorials/how-to-set-up-an-nfs-mount-on-ubuntu-14-04), [Arch](https://wiki.archlinux.org/index.php/NFS#Installation), and [RHEL/CentOS](https://www.digitalocean.com/community/tutorials/how-to-set-up-an-nfs-mount-on-centos-6).* - - **Versions**: *Make sure you're running the latest releases of Vagrant, VirtualBox, and Ansible—as of February 2016, Drupal VM recommends: Vagrant 1.8.1, VirtualBox 5.0.20, and Ansible 2.1.0.* + - **Versions**: *Make sure you're running the latest releases of Vagrant, VirtualBox, and Ansible—as of February 2016, Drupal VM recommends: Vagrant 1.8.4, VirtualBox 5.0.24, and Ansible 2.1.0.* ### 2 - Build the Virtual Machine From e4ebaecbc705aa5eb5aa05f16a206509421d9401 Mon Sep 17 00:00:00 2001 From: jonathanjfshaw <jonathanjfshaw@gmail.com> Date: Sun, 3 Jul 2016 21:47:33 +0100 Subject: [PATCH 0356/1273] Emphasised need to install Virtualbox --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 47575c5e0..ef411ff8e 100644 --- a/README.md +++ b/README.md @@ -67,7 +67,7 @@ But Drupal VM allows you to build your site exactly how you like, using whatever Download and install [Vagrant](https://www.vagrantup.com/downloads.html). -Vagrant will automatically install [VirtualBox](https://www.virtualbox.org/wiki/Downloads) if no providers are available (Drupal VM also works with Parallels or VMware, if you have the [Vagrant VMware integration plugin](http://www.vagrantup.com/vmware)). +Download and install [VirtualBox](https://www.virtualbox.org/wiki/Downloads). Vagrant will automatically do this if you have the paid-for [Vagrant VMware integration plugin](http://www.vagrantup.com/vmware), and no alternative provider like Parallels or VMware already installed. Notes: From 2d835826de127e427b9a8287bdd2d84a65779761 Mon Sep 17 00:00:00 2001 From: Jeff Geerling <geerlingguy@mac.com> Date: Sun, 3 Jul 2016 16:39:02 -0500 Subject: [PATCH 0357/1273] Switch from ssmtp to mhsendmail. --- default.config.yml | 2 +- provisioning/requirements.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/default.config.yml b/default.config.yml index 58c3eac14..53d267c3a 100644 --- a/default.config.yml +++ b/default.config.yml @@ -218,7 +218,7 @@ php_memory_limit: "192M" php_display_errors: "On" php_display_startup_errors: "On" php_realpath_cache_size: "1024K" -php_sendmail_path: "/usr/sbin/ssmtp -t" +php_sendmail_path: "/opt/mailhog/mhsendmail" php_opcache_enabled_in_ini: true php_opcache_memory_consumption: "192" php_opcache_max_accelerated_files: 4096 diff --git a/provisioning/requirements.yml b/provisioning/requirements.yml index 88f7c2358..7602bea96 100644 --- a/provisioning/requirements.yml +++ b/provisioning/requirements.yml @@ -26,7 +26,7 @@ - src: geerlingguy.java version: 1.4.0 - src: geerlingguy.mailhog - version: 1.1.0 + version: 2.0.0 - src: geerlingguy.memcached version: 1.0.4 - src: geerlingguy.mysql From e283d263bc76c6bdf14a3310f03aaa02909fd605 Mon Sep 17 00:00:00 2001 From: jonathanjfshaw <jonathanjfshaw@gmail.com> Date: Mon, 4 Jul 2016 16:27:26 +0100 Subject: [PATCH 0358/1273] 2nd attempt to clarify Vagrant/Virtualbox installation. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index ef411ff8e..1ea1d5a82 100644 --- a/README.md +++ b/README.md @@ -67,7 +67,7 @@ But Drupal VM allows you to build your site exactly how you like, using whatever Download and install [Vagrant](https://www.vagrantup.com/downloads.html). -Download and install [VirtualBox](https://www.virtualbox.org/wiki/Downloads). Vagrant will automatically do this if you have the paid-for [Vagrant VMware integration plugin](http://www.vagrantup.com/vmware), and no alternative provider like Parallels or VMware already installed. +Vagrant will automatically install [VirtualBox](https://www.virtualbox.org/wiki/Downloads) if no VM provider is installed. If you want to use an alternative provider like Parallels or VMware, you will need to install the [Vagrant VMware integration plugin](http://www.vagrantup.com/vmware). Notes: From 19ff6be759a887a3311df9d66acc4016d8ec18c7 Mon Sep 17 00:00:00 2001 From: Jeff Geerling <geerlingguy@mac.com> Date: Thu, 7 Jul 2016 22:51:24 -0500 Subject: [PATCH 0359/1273] Bump requirements for MySQL role so large table prefixes are configurable. --- provisioning/requirements.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/provisioning/requirements.yml b/provisioning/requirements.yml index 7602bea96..46b6d8136 100644 --- a/provisioning/requirements.yml +++ b/provisioning/requirements.yml @@ -30,7 +30,7 @@ - src: geerlingguy.memcached version: 1.0.4 - src: geerlingguy.mysql - version: 2.2.3 + version: 2.3.0 - src: geerlingguy.nginx version: 1.9.2 - src: geerlingguy.nodejs From 458b03ad5b7de990f42d4f8b2fbfafa7070877a4 Mon Sep 17 00:00:00 2001 From: Domenic Santangelo <domenics@gmail.com> Date: Fri, 8 Jul 2016 15:24:37 -0700 Subject: [PATCH 0360/1273] Updates default.config.yml for php-fpm user Updates default.config.yml to include a stub for defining the user that php-fpm runs as. See #781 --- default.config.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/default.config.yml b/default.config.yml index 53d267c3a..18dbfcd32 100644 --- a/default.config.yml +++ b/default.config.yml @@ -230,6 +230,10 @@ php_max_input_vars: "4000" php_enable_php_fpm: true php_fpm_listen: "127.0.0.1:9000" +# If you want to run php-fpm as a user other than your OS's default user, +# uncomment this line and specify. For example, to run as the "nginx" user: +# php_fpm_pool_user: "nginx" + composer_path: /usr/bin/composer composer_home_path: "/home/{{ drupalvm_user }}/.composer" composer_home_owner: "{{ drupalvm_user }}" From 530e83845b73a5a42537772c651e7c0c310aa2b5 Mon Sep 17 00:00:00 2001 From: Jeff Geerling <geerlingguy@mac.com> Date: Sun, 10 Jul 2016 23:39:46 -0500 Subject: [PATCH 0361/1273] Fixes #791: Update URLs to https (yay for Let's Encrypt). --- README.md | 2 +- composer.json | 2 +- docs/index.md | 2 +- provisioning/templates/dashboard.html.j2 | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 47575c5e0..481b23403 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ [![Build Status](https://travis-ci.org/geerlingguy/drupal-vm.svg?branch=master)](https://travis-ci.org/geerlingguy/drupal-vm) [![Documentation Status](https://readthedocs.org/projects/drupal-vm/badge/?version=latest)](http://docs.drupalvm.com) [![Packagist](https://img.shields.io/packagist/v/geerlingguy/drupal-vm.svg)](https://packagist.org/packages/geerlingguy/drupal-vm) -[Drupal VM](http://www.drupalvm.com/) is A VM for local Drupal development, built with Vagrant + Ansible. +[Drupal VM](https://www.drupalvm.com/) is A VM for local Drupal development, built with Vagrant + Ansible. This project aims to make spinning up a simple local Drupal test/development environment incredibly quick and easy, and to introduce new developers to the wonderful world of Drupal development on local virtual machines (instead of crufty old MAMP/WAMP-based development). diff --git a/composer.json b/composer.json index 8e4b76057..5a4cd713a 100644 --- a/composer.json +++ b/composer.json @@ -3,7 +3,7 @@ "type": "project", "description": "A VM for local Drupal development, built with Vagrant + Ansible", "keywords": ["vagrant", "vm", "virtual machine", "drupal"], - "homepage": "http://www.drupalvm.com", + "homepage": "https://www.drupalvm.com", "license": "MIT", "authors": [ { diff --git a/docs/index.md b/docs/index.md index 14c156114..a10ae6c37 100644 --- a/docs/index.md +++ b/docs/index.md @@ -1,6 +1,6 @@ <p align="center"><img src="images/drupal-vm-logo.png" alt="Drupal VM Logo" /></p> -[Drupal VM](http://www.drupalvm.com/) is A VM for local Drupal development, built with Vagrant + Ansible. +[Drupal VM](https://www.drupalvm.com/) is A VM for local Drupal development, built with Vagrant + Ansible. Welcome to Drupal VM's documentation site! Please read through the [Quick Start Guide](https://github.com/geerlingguy/drupal-vm#quick-start-guide) to get started, and then browse the rest of this project's documentation in the sidebar. diff --git a/provisioning/templates/dashboard.html.j2 b/provisioning/templates/dashboard.html.j2 index 99eaf6e17..bf102859a 100644 --- a/provisioning/templates/dashboard.html.j2 +++ b/provisioning/templates/dashboard.html.j2 @@ -292,7 +292,7 @@ <section class="jumbotron"> <div class="row"> <div class="col-md-7 text-center"> - <a href="http://www.drupalvm.com/"><img src="http://docs.drupalvm.com/en/latest/images/drupal-vm-logo.png" alt="Drupal VM" title="Welcome to Drupal VM"></a> + <a href="https://www.drupalvm.com/"><img src="http://docs.drupalvm.com/en/latest/images/drupal-vm-logo.png" alt="Drupal VM" title="Welcome to Drupal VM"></a> <p><a href="https://github.com/geerlingguy/drupal-vm">Drupal VM</a> is a VM for local Drupal development, built with Vagrant + Ansible.</p> <p><a class="btn btn-primary btn-lg" href="http://docs.drupalvm.com/en/latest/" role="button">Read the documentation</a></p> </div> From 85f6021e206aa6e2b2dae61a7e23ede3ada9d993 Mon Sep 17 00:00:00 2001 From: Jeff Geerling <geerlingguy@mac.com> Date: Sun, 10 Jul 2016 23:43:25 -0500 Subject: [PATCH 0362/1273] Fixes #782: VM favicon for Drupal VM dashboard. --- provisioning/templates/dashboard.html.j2 | 1 + 1 file changed, 1 insertion(+) diff --git a/provisioning/templates/dashboard.html.j2 b/provisioning/templates/dashboard.html.j2 index bf102859a..cf4259255 100644 --- a/provisioning/templates/dashboard.html.j2 +++ b/provisioning/templates/dashboard.html.j2 @@ -2,6 +2,7 @@ <head> <title>Drupal VM +