templates/Vagrantfile.erb in kitchen-vagrant-0.19.0 vs templates/Vagrantfile.erb in kitchen-vagrant-0.20.0
- old
+ new
@@ -12,14 +12,18 @@
<% if config[:box_version] %>
c.vm.box_version = "<%= config[:box_version] %>"
<% end %>
-<% if config[:box_check_update] %>
+<% if !config[:box_check_update].nil? %>
c.vm.box_check_update = "<%= config[:box_check_update] %>"
<% end %>
+<% if !config[:box_download_insecure].nil? %>
+ c.vm.box_download_insecure = "<%= config[:box_download_insecure] %>"
+<% end %>
+
<% if config[:vm_hostname] %>
c.vm.hostname = "<%= config[:vm_hostname] %>"
<% end %>
<% if config[:communicator] %>
@@ -56,10 +60,14 @@
<% config[:winrm].each do |key, value| %>
c.winrm.<%= key %> = <%= value %>
<% end %>
<% end %>
+<% if config[:boot_timeout] %>
+ c.vm.boot_timeout = <%= config[:boot_timeout] %>
+<% end %>
+
<% Array(config[:network]).each do |opts| %>
c.vm.network(:<%= opts[0] %>, <%= opts[1..-1].join(", ") %>)
<% end %>
c.vm.synced_folder ".", "/vagrant", disabled: true
@@ -71,15 +79,27 @@
<% case config[:provider]
when "virtualbox", /^vmware_/
if config[:gui] == true || config[:gui] == false %>
p.gui = <%= config[:gui] %>
<% end
+ end
+
+ case config[:provider]
+ when "virtualbox", /^vmware_/, "parallels"
+ if config[:linked_clone] == true || config[:linked_clone] == false %>
+ p.linked_clone = <%= config[:linked_clone] %>
+<% end
end %>
+
<% config[:customize].each do |key, value| %>
<% case config[:provider]
when "libvirt" %>
+ <% if value.is_a? String %>
+ p.<%= key %> = "<%= value%>"
+ <% else %>
p.<%= key %> = <%= value%>
+ <% end %>
<% when "lxc" %>
<% if key == :container_name %>
p.container_name = <%= value == ":machine" ? value : "\"#{value}\"" %>
<% elsif key == :backingstore %>
p.backingstore = "<%= value %>"
@@ -93,11 +113,15 @@
<% when "managed" %>
<% if key == :server %>
p.server = "<%= value %>"
<% end %>
<% when "parallels" %>
+ <% if key == :memory || key == :cpus %>
+ p.<%= key %> = <%= value %>
+ <% else %>
p.customize ["set", :id, "--<%= key.to_s.gsub('_', '-') %>", "<%= value %>"]
+ <% end %>
<% when "rackspace" %>
p.<%= key %> = "<%= value%>"
<% when "softlayer" %>
<% if key == :disk_capacity %>
p.<%= key %> = <%= value %>
@@ -116,10 +140,10 @@
p.vmx["numvcpus"] = "<%= value %>"
<% end %>
<% else %>
p.vmx["<%= key %>"] = "<%= value %>"
<% end %>
- <% when "openstack" %>
+ <% when "openstack", "cloudstack", "hyperv" %>
<% if value.is_a? String %>
p.<%= key %> = "<%= value%>"
<% else %>
p.<%= key %> = <%= value%>
<% end %>