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

Commit

Permalink
Fixes #136: Add unique Drupal VM machine name identifier.
Browse files Browse the repository at this point in the history
  • Loading branch information
geerlingguy committed Jul 1, 2015
1 parent ac2b6f0 commit 216d38b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,6 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
end

# Set the name of the VM. See: http://stackoverflow.com/a/17864388/100134
config.vm.define :drupaldev do |drupaldev_config|
config.vm.define vconfig['vagrant_machine_name'] do |d|
end
end
7 changes: 5 additions & 2 deletions example.config.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
---
# Vagrant configuration.
# `vagrant_box` can also be set to geerlingguy/centos6, geerlingguy/centos7,
# geerlingguy/ubuntu1204, parallels/ubuntu-14.04, etc.
vagrant_box: geerlingguy/ubuntu1404
vagrant_user: vagrant

# If you need to run multiple instances of Drupal VM, set a unique hostname,
# machine name, and IP address for each instance.
vagrant_hostname: drupalvm.dev
vagrant_machine_name: drupalvm
vagrant_ip: 192.168.88.88
vagrant_user: vagrant

# 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
Expand Down
6 changes: 2 additions & 4 deletions provisioning/tasks/drush-aliases.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,11 @@
sudo: no
when: configure_local_drush_aliases and (local_drush_config_folder.stat.exists == false)

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

0 comments on commit 216d38b

Please sign in to comment.