Skip to content
This repository was archived by the owner on Feb 13, 2023. It is now read-only.

Commit 216d38b

Browse files
committed
Fixes #136: Add unique Drupal VM machine name identifier.
1 parent ac2b6f0 commit 216d38b

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed

Vagrantfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,6 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
8585
end
8686

8787
# Set the name of the VM. See: http://stackoverflow.com/a/17864388/100134
88-
config.vm.define :drupaldev do |drupaldev_config|
88+
config.vm.define vconfig['vagrant_machine_name'] do |d|
8989
end
9090
end

example.config.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
---
2-
# Vagrant configuration.
32
# `vagrant_box` can also be set to geerlingguy/centos6, geerlingguy/centos7,
43
# geerlingguy/ubuntu1204, parallels/ubuntu-14.04, etc.
54
vagrant_box: geerlingguy/ubuntu1404
5+
vagrant_user: vagrant
6+
7+
# If you need to run multiple instances of Drupal VM, set a unique hostname,
8+
# machine name, and IP address for each instance.
69
vagrant_hostname: drupalvm.dev
10+
vagrant_machine_name: drupalvm
711
vagrant_ip: 192.168.88.88
8-
vagrant_user: vagrant
912

1013
# A list of synced folders, with the keys 'local_path', 'destination', 'id', and
1114
# a 'type' of [nfs|rsync|smb] (leave empty for slow native shares). See

provisioning/tasks/drush-aliases.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,11 @@
1515
sudo: no
1616
when: configure_local_drush_aliases and (local_drush_config_folder.stat.exists == false)
1717

18-
# Two notes:
19-
# 1. Doesn't work for Windows, since Ansible's running in the VM.
20-
# 2. The most-recently-provisioned Drupal VM instance will control this file.
18+
# Note that this doesn't work for Windows, since Ansible's running in the VM.
2119
- name: Configure host machine drush aliases.
2220
template:
2321
src: ../templates/drupalvm.aliases.drushrc.php.j2
24-
dest: ~/.drush/drupalvm.aliases.drushrc.php
22+
dest: "~/.drush/{{ vagrant_machine_name }}.aliases.drushrc.php"
2523
delegate_to: 127.0.0.1
2624
sudo: no
2725
when: configure_local_drush_aliases

0 commit comments

Comments
 (0)