5

Very often when running ansible-playbook on the Vagrant VM from Windows, I need to stop in the middle of something by pressing Ctrl+C. This happens if ansible becomes unresponsive or there is some bug we need to fix asap, so there is no point of waiting until provisioner completes.

The probem is that Ctrl+C does not work, some 2 ruby.exe processes get stuck in process tree. Any subsequent vagrant commands fail until you manually kill these ruby processes.

I also use to kill all stucked python ansible processes on the VM before running new provision.

Any way to handle it more jently?

Ross
  • 1,641
  • 3
  • 15
  • 16
  • I voted to close because vagrant questions are off topic – Rob Nov 07 '22 at 00:24
  • try answers from this question: https://superuser.com/questions/975074/is-there-a-way-to-stop-ctrlc-from-closing-a-tab-when-running-git-bash-in-cons/1751445#1751445 – Yevgeniy Afanasyev Nov 17 '22 at 23:07

3 Answers3

0

I found this problem as well on Windows and using Puppet Apply. The only way I can happily kill it by opening another terminal/cmd and then vagrant ssh -- sudo pkill puppet. That gracefully terminates the process, and allows me to regain control of my first terminal again.

Felipe Alvarez
  • 3,720
  • 2
  • 33
  • 42
0

In short the solution is:

Take a terminal that works.

  1. I find one working gitbash v2.32.0.windows..

The latest available gitbash currently is v2.38.1. But only the old one is working correctly with Vagrant(Oracle VM). The strange thing is that the latest one (gitbash v2.38.1) is working fine with SSH connections to AWS EC2 instances.

  1. Alternatively. Windows PowerShell is working fine with Vagrant(Oracle VM).

If someone needs my bad experience, here it is. The following terminals DON'T WORK

  • gitbash v2.38.1 (latest for now)
  • gitbash V2.36.0
  • ConEmu v220807 Alhpa (latest for now)
  • cmder v1.3.20.1282 (latest for now)
Yevgeniy Afanasyev
  • 37,872
  • 26
  • 173
  • 191
  • Hover over the vagrant tag and read that pop up. Vagrant is off topic and you should vote to close this old question – Rob Nov 06 '22 at 23:31
-1

I propose using vagrant halt.

Yunnosch
  • 26,130
  • 9
  • 42
  • 54
Paul-Marie
  • 874
  • 1
  • 6
  • 24