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?

kenorb
  • 5,943
  • 1
  • 44
  • 53

2 Answers2

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
Tombart
  • 2,013
  • 3
  • 27
  • 47
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.

faker
  • 17,326
  • 2
  • 60
  • 69