So the solution I have resorted to is to drop out to the host, apply a 
powershell wrapper around the DC instantiation and provisioning, with traps 
and tests for WinRM connectivity being re-established, then dropping back 
to the parent session and provision the remain hosts.

Vagrant.configure(2) do |allhosts|
  puts 'Use script wrapper to manage Domain Controller intermittent 
failures'
  puts "vagrant action  = #{ARGV[0]}"
  puts "first argument  = #{ARGV[1]}"
  puts "second argument = #{ARGV[2]}"
  result = system("./automation/provisioning/runner.bat 
./automation/provisioning/dcProvision.ps1 #{ARGV[0]} #{ARGV[1]} #{ARGV[2]}")
  puts "result        = #{result}"

This is a far from ideal implementation but it works. The runner.bat is a 
simple handler for switching from CMD to PowerShell.

set "back=\"
set "command=%cd%%back%%1"
echo %command% %2 %3 %4 %5 %6 %7 %8 %9
call powershell -NoProfile -ExecutionPolicy ByPass -command %command% %2 %3 
%4 %5 %6 %7 %8 %9

-- 
This mailing list is governed under the HashiCorp Community Guidelines - 
https://www.hashicorp.com/community-guidelines.html. Behavior in violation of 
those guidelines may result in your removal from this mailing list.

GitHub Issues: https://github.com/mitchellh/vagrant/issues
IRC: #vagrant on Freenode
--- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vagrant-up/2fdca60b-086c-447d-b70c-0f192d1ff53c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to