ARTIFACTORY: How to Configure Artifactory with Chef Repositories
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:
- Create Chef repositoriesusing theQuick Setup. This will create a virtual Chef repository that aggregates a remote (chef-remote) and a local (chef-local) repositories.
- 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 pluginmentioned in the prerequisites above. To check whether the plugin was installed successfully you can use the commandknife artifactory:
3. After installing and configuring the Knife client to work with Artifactory, you'll need toresolve a packagefrom the defaultChef registry:
Theseven_zippackage is successfully installed.
How to deploy your own cookbook to Artifactory
- Here’s an example of a new cookbook that’s been generated in the cookbooks location:
- After creating the cookbook, it is now ready fordeploymentto Artifactory. In order to deploy to Artifactory, we will use the following command:
- And here’s the package, successfully deployed to Artifactory:
发表:2018年7月6日
Last updated: May 24, 2021
Keywords: Chef, Knife