How to update Puppetfile to API URL v3?

1.5k Views Asked by At

I use Vagrant with Puppet. My Puppetfile looks like this:

forge "http://forge.puppetlabs.com"
mod 'willdurand/nodejs'
# ...

I use librarian-puppet v1.1.2 to download necessary dependencies for Puppet. Recenlty the tool started to display warnings during provision:

Replacing Puppet Forge API URL to use v3 https://forgeapi.puppetlabs.com. 
You should update your Puppetfile

Replacing the first Puppetfile line with forge "https://forgeapi.puppetlabs.com" does not solve the problem. How exacly am I supposed to update my Puppetfile to get rid of these warnings?


After I have updated the forge.rb script, as @AndreiFecioru suggested:

if uri =~ %r{^http(s)?://forge\.puppetlabs\.com}
  puts "---------------> #{uri}"
  uri = "https://forgeapi.puppetlabs.com"
  warn { "Replacing Puppet Forge API URL to use v3 #{uri}. You should update your Puppetfile" }
end

the output is as follows:

$sudo librarian-puppet update
---------------> http://forge.puppetlabs.com
Replacing Puppet Forge API URL to use v3 https://forgeapi.puppetlabs.com. You should update your Puppetfile
...

I have no idea why the URL there is different than in my Puppetfile. I tried to remove the Puppetfile.lock and run librarian-puppet install again - warnings are still displayed.

2

There are 2 best solutions below

2
On

What version of the librarian-puppet gem are you using? I got the same warning message, switched to the "v3" form (forge "https://forgeapi.puppetlabs.com") and it worked fine (no more warning messages).

After a quick Google search I noticed that this issue got fixed in version 1.1.0 of the gem (see this thread here: https://github.com/rodjek/librarian-puppet/issues/210). I am using version 1.1.2 of the librarian-puppet gem and it seems ok.

0
On

Probably one of your dependencies is using the old forge "http://forge.puppetlabs.com" line.

It's just a warning and can be ignored.