0

I'm trying to use the librarian-puppet to fetch forge modules from an Artifactory repository.

In my Puppetfile I have something like:

forge "https://<artifactory_host>/artifactory/api/puppet/<repo_key>" #From artifactory docs

# PuppetLabs Modules
mod 'puppetlabs/stdlib',           '4.24.0'

The command that I'm using is /usr/local/bin/pdk bundle -- exec librarian-puppet install --no-use-v1-api --verbose

The error that I get is:

[Librarian] Resolving puppetlabs-stdlib (= 4.24.0) <https://<artifactory_host>/artifactory/api/puppet/<repo_key>>
[Librarian]   Checking manifests Unable to find module 'puppetlabs-stdlib' on https://<artifactory_host>/artifactory/api/puppet/<repo_key>
/tmp/tmp.BXyhBoNRiR/.pdk/cache/ruby/2.1.0/gems/librarian-puppet-3.0.0/lib/librarian/puppet/source/forge/repo_v3.rb:44:in `rescue in get_module'
/tmp/tmp.BXyhBoNRiR/.pdk/cache/ruby/2.1.0/gems/librarian-puppet-3.0.0/lib/librarian/puppet/source/forge/repo_v3.rb:41:in `get_module'

Versions:

  • puppet 3.8.7
  • pdk 1.5.0
  • ruby 2.1.9

According to the documentation at https://www.jfrog.com/confluence/display/RTF/Puppet+Repositories#PuppetRepositories-Usinglibrarian-puppet, it seems I'm trying to get the modules correctly using the librarian-puppet, but something most be missing.

Thanks for any help.

Daniel Serrão
  • 481
  • 1
  • 6
  • 17

2 Answers2

2

I think Artifacotry does not support Puppet 3.8.7 its documented in Wiki.

Puppet version support

Puppet does not support a context path up to version 4.9.1, we recommend using Artifactory with Puppet version 4.9.2 and above. Please see below if you are using Puppet 4.9.1 and below.

Jainish Shah
  • 1,217
  • 10
  • 15
  • Hi Jainish. Thanks for the response. In this case changing the puppet version is not an option. This means that using the librarian-puppet is not possible? The goal is to use the Puppetfile and get the modules from an internal Artifactory repository. – Daniel Serrão Jul 06 '18 at 09:40
  • You can use Nginx to rewrite URL. As documented in the wiki. – Jainish Shah Jul 06 '18 at 17:46
1

The official Artifactory documentation (not a wiki) recommends using Puppet 4.9.2 or later with Artifactory:

Puppet version support

Puppet does not support a context path up to version 4.9.1, we recommend using Artifactory with Puppet version 4.9.2 and above. Please see below if you are using Puppet 4.9.1 and below.

(Emphasis in the original.)

As that comment indicates, however, the docs do also suggest a workaround for use with earlier Puppet:

If you need to use Puppet 4.9.1 and below you can use a workaround which uses NGINX or Apache to rewrite all requests from /v3/* to /artifactory/api/puppet/<repo-name>/v3/*.

The docs go on to present some example configurations, which I will not repeat here.

John Bollinger
  • 160,171
  • 8
  • 81
  • 157