Created
September 6, 2017 22:59
-
-
Save lira92/658560462f4faf6b9f3d86c325cf6294 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- 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