Ask Your Question

How to use puppet modules that require upstart with docker?

asked 2014-09-08 11:37:50 -0500

vang gravatar image

updated 2014-09-13 11:07:18 -0500


There seems to be no way to get puppet modules requiring upstart to work in docker. The use of the ubuntu-upstart image gets ride of the Could not evaluate: undefined method `[]' for nil:NilClass error.

However, I immediately hit the Unable to connect to Upstart error. The work around for which is to modify initctl to return true with:

dpkg-divert --local --rename --add /sbin/initctl
ln -s /bin/true /sbin/initctl

Then I'm back to the Could not evaluate: undefined method `[]' for nil:NilClass error.

I use a few module that requires upstart and it seems like I'm stuck with one of the problems. What to do about the catch 22???

Jerome Petazzoni suggests changing the provider=base on this Google groups topic.

I've tested that with the upstart image and it seems to work. I'm not sure what setting the provider=base does, so don't know what the proper fix should be. Should docker support better upstart support for puppet modules or should puppet modules just use the provider=base work around?

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

answered 2014-09-18 21:18:03 -0500

hesco gravatar image

I have been using the phusion baseimage (my own derivative of it actually). And I find that my Service[] resources report success without actually succeeding. I've written bash scripts to harvest results from the ps list to define a custom status action, but what has been most useful has been to set provider => init in my Service[] resources. I just ignore the upstart and treat the image like a debian box to get my services to start from the puppet catalogue. That seems to be working for me.

edit flag offensive delete link more


The init provider works better than the base one. Some modules like the puppetlabs/mongodb gave a "Error: /Service[mongodb]: Services must specify a start command or a binary" when provider=base and no start stop command was specified, but works fine with provider=init.

vang gravatar imagevang ( 2014-09-22 07:56:47 -0500 )edit

answered 2014-09-10 10:55:04 -0500

spuder gravatar image

The problem you are running into likely isn't a puppet problem, but a problem with docker and init systems on ubuntu based containers.

You could try using the phusion docker containers which have fixed some of these problems on ubuntu

edit flag offensive delete link more


I was originally using the phusion base image but hit the Could not evaluate: undefined method `[]' for nil:NilClass error while trying to install mysql with the puppetlabs module because it seems to require the upstart stuff. So I switch to the upstart image and hit the above problems.

vang gravatar imagevang ( 2014-09-13 11:00:57 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2014-09-08 11:26:53 -0500

Seen: 802 times

Last updated: Sep 18 '14