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

Commit

Permalink
Merge pull request #816 from geerlingguy/ansible-local
Browse files Browse the repository at this point in the history
Fixes #450: Switch to Vagrant's ansible_local provisioner.
  • Loading branch information
geerlingguy authored Jul 23, 2016
2 parents 76d961e + 1546930 commit befb610
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 155 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,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.4, VirtualBox 5.0.24, 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.5, VirtualBox 5.0.24, and Ansible 2.1.0.*

### 2 - Build the Virtual Machine

Expand Down
19 changes: 6 additions & 13 deletions Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
# Allow override of the default synced folder type.
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.
# Provisioning. Use ansible if it's installed, ansible_local if not.
if which('ansible-playbook')
config.vm.provision 'ansible' do |ansible|
ansible.playbook = "#{host_drupalvm_dir}/provisioning/playbook.yml"
Expand All @@ -127,20 +127,13 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
}
end
else
config.vm.provision 'shell' do |sh|
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"
config.vm.provision 'ansible_local' do |ansible|
ansible.playbook = "#{guest_drupalvm_dir}/provisioning/playbook.yml"
ansible.extra_vars = {
config_dir: guest_config_dir
}
end
end
# ansible_local provisioner is broken in Vagrant < 1.8.2.
# else
# config.vm.provision "ansible_local" do |ansible|
# ansible.playbook = "#{guest_drupalvm_dir}/provisioning/playbook.yml"
# ansible.extra_vars = {
# config_dir: guest_config_dir
# }
# end
# end

# VMware Fusion.
config.vm.provider :vmware_fusion do |v, override|
Expand Down
20 changes: 0 additions & 20 deletions provisioning/JJG-Ansible-Windows/LICENSE

This file was deleted.

42 changes: 0 additions & 42 deletions provisioning/JJG-Ansible-Windows/README.md

This file was deleted.

79 changes: 0 additions & 79 deletions provisioning/JJG-Ansible-Windows/windows.sh

This file was deleted.

0 comments on commit befb610

Please sign in to comment.