ARTIFACTORY: How to Configure Artifactory with Chef Repositories

Yonatan Brand
2023-01-22 11:05

First, install theChef Development Kit(ChefDK).Note:The Knife command-line tool doesnot
support basic authentication, only authentication withRSAkeys. If your Artifactory instance requires
authentication, you'll need to install RubyGemsknife-artplugin. For installation instructions, please
refer to theArtifactory User Guide.

To configure aKnife clientto work with Artifactory:

  1. Create Chef repositoriesusing theQuick Setup. This will create a virtual Chef repository that aggregates a remote (chef-remote) and a local (chef-local) repositories.
  2. Edit yourknife.rbfile (located in$USER_HOME/.chef/). If it doesn’t exist,create itusing this$ vim knife.rb

In the following example, as Artifactory requires authentication, we added a basic
authentication configuration to the URL. To do this yourself, you will need to install theknife-
art plugin
mentioned in the prerequisites above. To check whether the plugin was installed successfully you can use the commandknife artifactory:
User-added image

3. After installing and configuring the Knife client to work with Artifactory, you'll need toresolve a packagefrom the defaultChef registry:
User-added image
User-added image
Theseven_zippackage is successfully installed.

How to deploy your own cookbook to Artifactory

  1. Here’s an example of a new cookbook that’s been generated in the cookbooks location:User-added image
  2. After creating the cookbook, it is now ready fordeploymentto Artifactory. In order to deploy to Artifactory, we will use the following command:User-added image
  3. And here’s the package, successfully deployed to Artifactory:

User-added image

发表:2018年7月6日
Last updated: May 24, 2021

Keywords: Chef, Knife