Chef Client skip bundle install on air gapped server

344 Views Asked by At

I am trying to install chef recipes on air-gapped server I bundled gems listed in all recipes and prepared vendor/cache archive. Copying it into the server and running /opt/chef/embedded/bin/bunlde install --local successfully installed 233 gems but when i run chef-client -j boot.json it finds all gems and doesn't download but still run bundle install step and tries to access rubygems.org and fails

Running chef-client in debug mode doesn't reveal any gem name, its trying to download so i don't know what's missing. Is there anyway i can skip this step or know which gem is missing ?

1

There are 1 best solutions below

0
On

Part of the run after loading the cookbooks is to install the gems required in the cookbook metadata.rb.

The client prepare a Gemfile and launch a bundle install to check if the necessary gems are installed and up to date, that's the behavior of bundler and why it tries to connect to rubygems.org.

As said in the comments, vendoring all the gems on each server is far from being efficient, you'd better have an internal gem repository and point your cient to it.

That's nearly what you did, get all gems from your recipes, install them on an internal machine and run gem server.

That can be tedious, and there's other approaches allowing to mirror rubygem internally more easily described here