purple52/librarian-puppet-vagrant

Issue with provisioning to official quantal64 Ubuntu VM

Closed this issue · 4 comments

I am using the Ubuntu Quantal x64 box: http://cloud-images.ubuntu.com/quantal/current/quantal-server-cloudimg-vagrant-amd64-disk1.box

I receive the following output after provisioning:

d:\projects\quantal>vagrant provision
[default] Running provisioner: Vagrant::Provisioners::Shell...
stdin: is not a tty
Reading package lists...

Building dependency tree...

Reading state information...

The following extra packages will be installed:
  git-man liberror-perl
Suggested packages:
  git-daemon-run git-daemon-sysvinit git-doc git-el git-arch git-cvs git-svn
  git-email git-gui gitk gitweb
The following NEW packages will be installed:
  git git-man liberror-perl
0 upgraded, 3 newly installed, 0 to remove and 2 not upgraded.
Need to get 6,824 kB of archives.
After this operation, 15.3 MB of additional disk space will be used.
Get:1 http://archive.ubuntu.com/ubuntu/ quantal/main liberror-perl all 0.17-1 [23.8 kB]
Get:2 http://archive.ubuntu.com/ubuntu/ quantal/main git-man all 1:1.7.10.4-1ubuntu1 [634 kB]
Get:3 http://archive.ubuntu.com/ubuntu/ quantal/main git amd64 1:1.7.10.4-1ubuntu1 [6,165 kB]
dpkg-preconfigure: unable to re-open stdin: No such file or directory
Fetched 6,824 kB in 1min 19s (86.0 kB/s)
Selecting previously unselected package liberror-perl.
(Reading database ...
62005 files and directories currently installed.)
Unpacking liberror-perl (from .../liberror-perl_0.17-1_all.deb) ...
Selecting previously unselected package git-man.
Unpacking git-man (from .../git-man_1%3a1.7.10.4-1ubuntu1_all.deb) ...
Selecting previously unselected package git.
Unpacking git (from .../git_1%3a1.7.10.4-1ubuntu1_amd64.deb) ...
Processing triggers for man-db ...
Setting up liberror-perl (0.17-1) ...
Setting up git-man (1:1.7.10.4-1ubuntu1) ...
Setting up git (1:1.7.10.4-1ubuntu1) ...
Building native extensions.  This could take a while...
ERROR:  Error installing librarian-puppet:
        ERROR: Failed to build gem native extension.

        /usr/bin/ruby1.9.1 extconf.rb
/usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require': cannot load such file -- mkmf (LoadError)
        from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
        from extconf.rb:1:in `<main>'


Gem files will remain installed in /var/lib/gems/1.9.1/gems/json-1.7.7 for inspection.
Results logged to /var/lib/gems/1.9.1/gems/json-1.7.7/ext/json/ext/generator/gem_make.out
/tmp/vagrant-shell: 25: /tmp/vagrant-shell:
librarian-puppet: not found

The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!

chmod +x /tmp/vagrant-shell && /tmp/vagrant-shell

It seems I should install ruby-dev package. But how should I detect if it is already installed?
After installing ruby-dev I receive the following errors:

d:\projects\quantal>vagrant provision
[default] Running provisioner: Vagrant::Provisioners::Shell...
stdin: is not a tty
Building native extensions.  This could take a while...
Successfully installed json-1.7.7
Successfully installed librarian-puppet-0.9.8
2 gems installed
Installing ri documentation for json-1.7.7...
Installing ri documentation for librarian-puppet-0.9.8...
Installing RDoc documentation for json-1.7.7...
Installing RDoc documentation for librarian-puppet-0.9.8...
Unable to load puppet. Either install it using native packages for your
platform (eg .deb, .rpm, .dmg, etc) or as a gem (gem install puppet).
The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!

chmod +x /tmp/vagrant-shell && /tmp/vagrant-shell

Do I need to preinstall different software (like ruby, ruby-dev or puppet) before running provisioning? Or should it be installed automatically by the shell-script?

This project assumes you have puppet, ruby and rubygems installed on your base box. The Vagrant docs for Base Boxes says these are required. I think the basic idea is that you should use a base box that has been built specifically for the provisioner that your project uses. In this case, Puppet.

Potentially, you could install these dependencies using the shell provisioner like I do here for git, but that's beyond the scope of this project.

I'm not sure this can be closed, but it might be more particular to librarian-puppet itself.
With installed puppet package, I still got this particular issue. After installing the puppet gem it went away.
Probably means that librarian-puppet can't find the puppet executable, but it's installed in /usr/bin, which would be in any users path.

I do not think this is an issue that can be fixed within the scope of this project; it is a setup issue on the base box being used. See this issue raised against librarian-puppet: rodjek/librarian-puppet#99. I recommend that you try the Puppet Labs Vagrant Boxes for Ubuntu instead, although they only do LTS versions.

I changed to the puppetlabs box and it works now.