-
Notifications
You must be signed in to change notification settings - Fork 495
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Define vars on multi VM Vagrant file #407
Comments
My Ruby is a bit limited, but I think using some Ruby objects for each server might be appropriate. That would mean editing the Vagrantfile to contain or include other objects, then using those for each VM. Overall, however, I'd recommend using something more fancy. Consider using Ansible to setup each server. That would allow you to have one configuration usable for each VM in your "cluster". (Ansible can configure them all based on roles, or can make three duplicate servers - really any combo you might need). |
Hi Really thanks. |
Can you show your |
Simple sample of Vagrant file: Vagrant.configure("2") do |config|
#
config.vm.define "video" do |video|
video.vm.box = "ubuntu/trusty64"
video.vm.network "public_network", ip: "192.168.1.201", bridge: 'wlan0'
video.vm.synced_folder "/home/macklus/desarrollo/videomensajes.net", "/home/vagrant/"
video.vm.hostname = "videomensajes.local"
video.vm.provider :virtualbox do |vb|
vb.name = "videomensajes"
vb.customize ["modifyvm", :id, "--memory", 2048]
end
# Provision
video.vm.provision "shell", path: "scripts/base.sh", args: ["", "512", "UTC"]
video.vm.provision "shell", path: "scripts/base_box_optimizations.sh", privileged: true
video.vm.provision "shell", path: "scripts/php.sh", args: ["UTC", "false"]
video.vm.provision "shell", path: "scripts/nginx.sh", args: ["192.168.1.221", "/home/vagrant/public_html", "videomensajes.local", ""]
video.vm.provision "shell", path: "scripts/mariadb.sh", args: ["root", "true"]
video.vm.provision "shell", path: "scripts/screen.sh"
video.vm.provision "shell", path: "scripts/mailcatcher.sh"
end
end Is this enought ? |
Hi:
I use Vagrant to work with 3-4 VMs. I try Vaprobash and really like it, but i dont know how can i define vars (as mysql_root_password) inside a VM config block, and not in global block
is this possible?
Thanks in advance
The text was updated successfully, but these errors were encountered: