lib/catfish/templates/Vagrantfile.tt in catfish-0.0.2 vs lib/catfish/templates/Vagrantfile.tt in catfish-0.0.3

- old
+ new

@@ -1,26 +1,33 @@ # -*- mode: ruby -*- # vi: set ft=ruby : Vagrant.configure("2") do |config| - config.vm.box = "tknerr/managed-server-dummy" + config.vm.box = "tknerr/managed-server-dummy" <% config[:provisioners].each do |provisioner| -%> <% if provisioner == 'shell' -%> <% config[:shell_paths].each do |path| -%> - config.vm.provision 'shell', path: '<%= path %>' + config.vm.provision 'shell', path: '<%= path %>' <% end -%> <% end -%> <% end -%> - instances = File.readlines('Catfishfile.lock').map(&:chomp) - instances.each do |instance| - next if instance.start_with? '#' - config.vm.define "#{instance}" do |box| - box.vm.provider :managed do |managed, override| - managed.server = instance - override.ssh.username = '<%= config[:ssh_username] %>' - override.ssh.private_key_path = '<%= config[:ssh_private_key_path] %>' - end - end - end +<% if config[:communicator] == 'winrm' -%> + config.vm.communicator = '<%= config[:communicator] %>' + config.vm.winrm.username = '<%= config[:winrm_username] %>' + config.vm.winrm.password = '<%= config[:winrm_password] %>' +<% end -%> + + instances = File.readlines('Catfishfile.lock').map(&:chomp) + instances.each do |instance| + config.vm.define "#{instance}" do |box| + box.vm.provider :managed do |managed, override| + managed.server = instance +<% if config[:communicator] == 'ssh' -%> + override.ssh.username = '<%= config[:ssh_username] %>' + override.ssh.private_key_path = '<%= config[:ssh_private_key_path] %>' +<% end -%> + end + end + end end