managed_servers = %w( <% servers.each do |s| -%><%= s %> <% end -%>) <% if plugins.any? -%> required_plugins = %w( <% plugins.each do |p| -%><%= p %> <% end -%>) required_plugins.each do |plugin| system "vagrant plugin install #{plugin}" unless Vagrant.has_plugin? plugin end <% end %> Vagrant.configure("2") do |config| <% if provisioners.include? "shell" -%> <% shell_paths.each do |path| -%> config.vm.provision "shell", path: "<%= path %>" <% end -%> <% if shell_inline -%> config.vm.provision "shell", inline: "<%= shell_inline %>" <% end -%> <% end -%> <% if provisioners.include? "puppet" -%> <% if puppet_librarian_puppet -%> config.librarian_puppet.placeholder_filename = ".gitignore" <% end -%> config.vm.provision "puppet" do |puppet| <% if puppet_librarian_puppet -%> puppet.module_path = 'modules' <% end -%> <% if puppet_hiera -%> puppet.hiera_config_path = 'hiera.yaml' <% end -%> end <% end -%> <% if communicator == "ssh" -%> config.ssh.username = "<%= ssh_username %>" <% if ssh_password -%> config.ssh.password = "<%= ssh_password %>" <% end -%> <% if ssh_private_key_path -%> config.ssh.private_key_path = "<%= ssh_private_key_path %>" <% end -%> <% end -%> <% if communicator == "winrm" -%> config.vm.communicator = "<%= communicator %>" config.winrm.username = "<%= winrm_username %>" config.winrm.password = "<%= winrm_password %>" config.winrm.transport = :sspinegotiate <% end -%> managed_servers.each do |instance| config.vm.define "managed-#{instance}" do |box| box.vm.box = "tknerr/managed-server-dummy" box.vm.box_url = "./dummy.box" box.vm.provider :managed do |provider| provider.server = instance end end end end