Skip to content

Instantly share code, notes, and snippets.

@lira92
Created September 6, 2017 22:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lira92/658560462f4faf6b9f3d86c325cf6294 to your computer and use it in GitHub Desktop.
Save lira92/658560462f4faf6b9f3d86c325cf6294 to your computer and use it in GitHub Desktop.
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Check for missing plugins
required_plugins = %w(vagrant-winnfsd)
plugin_installed = false
required_plugins.each do |plugin|
unless Vagrant.has_plugin?(plugin)
system "vagrant plugin install #{plugin}"
plugin_installed = true
end
end
# If new plugins installed, restart Vagrant process
if plugin_installed === true
exec "vagrant #{ARGV.join' '}"
end
Vagrant.configure("2") do |config|
# use ubuntu xenial64 box
config.vm.box = "ubuntu/xenial64"
# set ip and hostname
config.vm.hostname = "scubiblue"
config.vm.network "private_network", ip: "192.168.33.2"
config.vm.synced_folder ".", "/vagrant"
config.vm.provider "virtualbox" do |vb|
# vm name on vb
vb.name = "scubiblue"
# vm memory - 512 para composer é pouco, mesmo com cache
vb.memory = "1024"
vb.customize ["modifyvm", :id, "--nictype1", "virtio"]
end
# Ansible provisioner.
config.vm.provision "ansible_local" do |ansible|
ansible.playbook = "provisioning/playbook.yml"
end
config.vm.provision :shell, path: "provisioning/files/swap.sh", run: "always"
config.vm.provision :shell, :inline => "service apache2 restart", run: "always"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment