lib/rzo/app/templates/Vagrantfile.erb in rzo-0.7.0 vs lib/rzo/app/templates/Vagrantfile.erb in rzo-0.8.0
- old
+ new
@@ -11,20 +11,39 @@
end
<%- nodes.each do |nc| -%>
config.vm.define <%= nc['name'].inspect %>, autostart: false do |cfg|
cfg.vm.box = <%= nc['box'].inspect %>
+ <%- if nc['box_url'] -%>
cfg.vm.box_url = <%= nc['box_url'].inspect %>
+ <%- end -%>
+ <%- if nc['box_download_checksum'] -%>
cfg.vm.box_download_checksum = <%= nc['box_download_checksum'].inspect %>
+ <%- end -%>
+ <%- if nc['box_download_checksum_type'] -%>
cfg.vm.box_download_checksum_type = <%= nc['box_download_checksum_type'].inspect %>
+ <%- end -%>
<%- if nc['boot_timeout'] -%>
cfg.vm.boot_timeout = <%= nc['boot_timeout'].inspect %>
<%- end -%>
+ <%- if nc['memory'] || nc['gui'] -%>
cfg.vm.provider :virtualbox do |vb|
+ <%- if nc['memory'] -%>
vb.customize ['modifyvm', :id, '--memory', <%= nc['memory'].inspect %>]
+ <%- end -%>
+ <%- if nc['gui'] -%>
+ vb.gui = <%= nc['gui'].inspect %>
+ <%- end -%>
end
+ <%- end -%>
+ <%- if nc['windows'] == true -%>
+ cfg.vm.guest = :windows
+ cfg.vm.communicator = :winrm
+ cfg.vm.hostname = <%= nc['name'].inspect %>
+ <%- else -%>
cfg.vm.hostname = <%= nc['hostname'].inspect %>
+ <%- end -%>
cfg.vm.network 'private_network',
ip: <%= nc['ip'].inspect %>,
netmask: <%= nc['netmask'].inspect %>
<%- [*nc['forwarded_ports']].each do |forwarded_port| -%>
cfg.vm.network 'forwarded_port',
@@ -38,19 +57,23 @@
<%- end -%>
<%- if nc['bootstrap_repo_path'] -%>
cfg.vm.synced_folder <%= nc['bootstrap_repo_path'].inspect %>,
<%= nc['bootstrap_guest_path'].inspect %>,
owner: 'vagrant', group: 'root'
+ <%- end -%>
<%- if nc[:puppetmaster] -%>
cfg.vm.provision 'shell', inline: <%= "echo 'modulepath = #{nc['modulepath'].join(':')}' > #{nc['bootstrap_guest_path']}/environment.conf".inspect %>
<%- end -%>
- cfg.vm.provision 'shell', inline: <%= "/bin/bash #{nc['bootstrap_guest_path']}/#{nc['bootstrap_script_path']} #{nc['bootstrap_script_args']}".inspect %>
- <%- if nc['update_packages'] -%>
+ <%- if nc['windows'] == true -%>
+ cfg.vm.provision 'shell', inline: <%= "#{nc['bootstrap_guest_path']}\\#{nc['bootstrap_script_path']} #{nc['bootstrap_script_args']}".inspect %>
+ <%- else -%>
+ cfg.vm.provision 'shell', inline: <%= "/bin/bash #{nc['bootstrap_guest_path']}/#{nc['bootstrap_script_path']} #{nc['bootstrap_script_args']}".inspect.chomp %>
+ <%- end -%>
+ <%- if nc['update_packages'] == true -%>
cfg.vm.provision 'shell', inline: <%= nc['update_packages_command'].inspect %>
<%- end -%>
- <%- if nc['shutdown'] -%>
+ <%- if nc['shutdown'] == true -%>
cfg.vm.provision 'shell', inline: <%= nc['shutdown_command'].inspect %>
- <%- end -%>
<%- end -%>
end
<%- end -%>
end
# -*- mode: ruby -*-