I've installed camptocamp/nagios from Puppet Forge, but seems it has dependencies to puppet-apache_c2c which is published on GitHub.

I've installed nagios module as suggested:

puppet module install camptocamp-nagios

However how do I install missing dependencies?

I've seen some JIRA ticket which would provide that ability, however it seems it's not implemented yet (status: ready for engineering). So for now is there any workaround? What's the correct approach of installing non-puppet-forge modules?

  • 1
    Use r10k like everyone else? – Michael Hampton Apr 24 '15 at 22:31
  • 1
    (I don't use r10k... should I?) – ewwhite Apr 24 '15 at 22:33
  • Thanks. I'm not a DevOp so I didn't hear about r10k. However I'll have a go. Other suggestions/methods are welcomed as well. – kenorb Apr 24 '15 at 22:36
  • What about librarian-puppet, is that suitable as well? – kenorb Apr 24 '15 at 23:06
  • @kenorb it's suitable but there really is no reason to use it instead of r10k. – jordanm Apr 25 '15 at 4:59

I personally don't use r10k or anything like that.
At the end of the day a puppet module is just a directory in your modules folder.
If you are using git to manage your modules you could add it as a submodule, like this:

cd modules
git submodule add https://github.com/camptocamp/puppet-apache_c2c.git apache_c2c

Of course this isn't doing any resolution of dependencies.
You'll have to check the metadata.json yourself and install those.
Which is OK for my case, we don't add modules very often.

  • Thanks, it worked. Which is cd /etc/puppet/modules; git init; git submodule add .... – kenorb Apr 25 '15 at 20:39

Using librarian-puppet:

gem install librarian-puppet

Check modulepath on Puppet master:

puppet config print modulepath --section master

Which will give you e.g. /etc/puppet/environments/production/modules.

Then create Puppetfile one level above path modulepath. i.e. /etc/puppet/environments/production/Puppetfile:

forge 'https://forgeapi.puppetlabs.com'

mod 'camptocamp-nagios', :git => 'https://github.com/camptocamp/puppet-nagios.git'

And run librarian-puppet install from the folder where is Puppetfile located.

In .librarian/puppet/config you can specify custom path for modules installation (relative from Puppetfile):

LIBRARIAN_PUPPET_PATH: environments/production/modules

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.