5

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?

5
  • 1
    Use r10k like everyone else? Commented Apr 24, 2015 at 22:31
  • 1
    (I don't use r10k... should I?) Commented Apr 24, 2015 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. Commented Apr 24, 2015 at 22:36
  • What about librarian-puppet, is that suitable as well? Commented Apr 24, 2015 at 23:06
  • @kenorb it's suitable but there really is no reason to use it instead of r10k. Commented Apr 25, 2015 at 4:59

2 Answers 2

3

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.

1
  • 1
    Thanks, it worked. Which is cd /etc/puppet/modules; git init; git submodule add .... Commented Apr 25, 2015 at 20:39
4

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 

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.