Host specific configuration within a loop

23 views
Skip to first unread message

Shai Ben-Naphtali

unread,
Sep 18, 2014, 4:57:26 AM9/18/14
to vagra...@googlegroups.com
Hello,

I've got this Vagrantfile setup (https://gist.github.com/shai/e2e180e8994531edad96) and I want to make sure that sbn-vm002 boots with 4 CPUs instead of 2.

How can I construct some sort of IF that would check the vm name and set 4 CPUs to that vm #2 ?

Thanks in advance!

---
Shai

Alvaro Miranda Aguilera

unread,
Sep 20, 2014, 9:30:50 PM9/20/14
to vagra...@googlegroups.com
try something like this

config.vm.provider "virtualbox" do |v|
if i = 2
v.cpus = 4
else
v.cpus = 2
end

--
You received this message because you are subscribed to the Google Groups "Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vagrant-up+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Shai Ben-Naphtali

unread,
Sep 22, 2014, 4:07:18 AM9/22/14
to vagra...@googlegroups.com
Brilliant :) thanks, it worked like a charm :)

FYI, needed to change if i = 2 ; to if i == 2 (using two equal signs)

--
You received this message because you are subscribed to a topic in the Google Groups "Vagrant" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/vagrant-up/znno1OYkkgI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to vagrant-up+...@googlegroups.com.

Alvaro Miranda Aguilera

unread,
Sep 22, 2014, 8:00:13 PM9/22/14
to vagra...@googlegroups.com
yeah that, sorry for the error. but you got the idea.

Reply all
Reply to author
Forward
0 new messages