mitchellh/vagrant — Issue #566: Puppet on JRuby hangs
Author: jkutner
Created: 2011-11-24 06:11:29+00:00
State: open

When trying to provision a box with Puppet, and JRuby on the box, the 'vagrant provision' command hangs.

This is due to line 126 of lib/vagrant/provisioners/puppet.rb never receiving an :exit_status

I have a hacky fix. I'll submit a pull request.

Steps to reproduce:

$ vagrant box add pp_jruby_bug http://files.vagrantup.com/lucid64.box
$ vagrant init pp_jruby_bug
$ vagrant up
$ vagrant ssh

vagrant@lucid64:~$ sudo apt-get update
vagrant@lucid64:~$ sudo apt-get install openjdk-6-jdk curl git-core g++
vagrant@lucid64:~$ sudo bash < <(curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer )
vagrant@lucid64:~$ source /etc/profile
vagrant@lucid64:~$ rvm reload
vagrant@lucid64:~$ sudo rvm install jruby
vagrant@lucid64:~$ sudo rvm use jruby --default
vagrant@lucid64:~$ sudo gem install puppet -v 2.6.12 --no-ri --no-rdoc

# add this to the Vagrantfile
config.vm.provision :puppet do |puppet|
puppet.manifests_path = "puppet/manifests"
puppet.manifest_file = "pp_jruby_bug.pp"
end

# create the file puppet/manifests/pp_jruby_bug.pp with this content
file {'testfile':
path => '/tmp/testfile',
ensure => present,
mode => 0640,
content => "I'm a test file.",
}

$ vagrant reload
[default] VM already created. Booting if its not already running...
[default] Clearing any previously set forwarded ports...
[default] Forwarding ports...
[default] -- ssh: 22 => 2222 (adapter 1)
[default] Cleaning previously set shared folders...
[default] Creating shared folders metadata...
[default] Running any VM customizations...
[default] Booting VM...
[default] Waiting for VM to boot. This can take a few minutes.
[default] VM booted and ready for use!
[default] Mounting shared folders...
[default] -- v-root: /vagrant
[default] -- manifests: /tmp/vagrant-puppet/manifests
[default] Running provisioner: Vagrant::Provisioners::Puppet...
[default] Running Puppet with pp_jruby_bug.pp...
[default] stdin: is not a tty
[default] notice: /Stage[main]//File[testfile]/ensure: created
[default]
[default] notice: Finished catalog run in 0.63 seconds
[default]

At this point the process just hangs, and I have to kill it.