The Cloudsmith Developer Hub

Welcome to the Cloudsmith Developer Hub. You'll find comprehensive guides and documentation to help you start working with Cloudsmith as quickly as possible, as well as support if you get stuck. Let's jump right in!

Get Started    

Chef

How to integrate Chef with Cloudsmith

Chef is a configuration management tool written in Ruby and Erlang. It uses a Ruby DSL for writing "recipes". Chef recipes are then used automate and maintain system configurations.

  • Chef : The Chef website.
  • Chef Docs : The Official Chef Documentation

In the following examples:

IdentifierDescription
OWNERYour Cloudsmith account name or organisation name (namespace)
REPOSITORYYour Cloudsmith Repository name (also called "slug")
DISTROYour distribution (i.e el, fedora, debian etc)
VERSIONYour version name (i.e 7, 29, hardy, buster etc)
ARCHThe architecture (i.e x86_64)
FINGERPRINTThe 8 Byte fingerprint of the Public GPG key for the repository
TOKENYour Cloudsmith Entitlement Token (see Entitlements for more details)
USERNAMEYour Cloudsmith username
PASSWORDYour Cloudsmith password
API-KEYYour Cloudsmith API Key

Adding a RPM repository

To configure a Cloudsmith repository for rpm packages using Chef, you use the Chef yum_repository resource.

Example yum_repository resource configurations:

Public Repository

yum_repository 'Cloudsmith' do
  description 'Cloudsmith'
  baseurl 'https://dl.cloudsmith.io/public/OWNER/REPOSITORY/rpm/DISTRO/VERSION/$basearch'
  gpgcheck 'true'
  gpgkey 'https://dl.cloudsmith.io/public/OWNER/REPOSITORY/cfg/gpg/gpg.FINGERPRINT.key'
  action :create
end

Private Repository

yum_repository 'Cloudsmith' do
  description 'Cloudsmith'
  baseurl 'https://dl.cloudsmith.io/TOKEN/OWNER/REPOSITORY/rpm/DISTRO/VERSION/$basearch'
  gpgcheck 'true'
  gpgkey 'https://dl.cloudsmith.io/TOKEN/OWNER/REPOSITORY/cfg/gpg/gpg.FINGERPRINT.key'
  action :create
end
yum_repository 'Cloudsmith' do
  description 'Cloudsmith'
  baseurl 'https://dl.cloudsmith.io/basic/OWNER/REPOSITORY/rpm/DISTRO/VERSION/$basearch'
  gpgcheck 'true'
  gpgkey 'https://dl.cloudsmith.io/basic/OWNER/REPOSITORY/cfg/gpg/gpg.FINGERPRINT.key'
  username 'USERNAME'
  password 'PASSWORD'
  action :create
end
yum_repository 'Cloudsmith' do
  description 'Cloudsmith'
  baseurl 'https://dl.cloudsmith.io/basic/OWNER/REPOSITORY/rpm/DISTRO/VERSION/$basearch'
  gpgcheck 'true'
  gpgkey 'https://dl.cloudsmith.io/basic/OWNER/REPOSITORY/cfg/gpg/gpg.FINGERPRINT.key'
  username 'USERNAME'
  password 'API-KEY'
  action :create
end
yum_repository 'Cloudsmith' do
  description 'Cloudsmith'
  baseurl 'https://dl.cloudsmith.io/basic/OWNER/REPOSITORY/rpm/DISTRO/VERSION/$basearch'
  gpgcheck 'true'
  gpgkey 'https://dl.cloudsmith.io/basic/OWNER/REPOSITORY/cfg/gpg/gpg.FINGERPRINT.key'
  username 'token'
  password 'TOKEN'
  action :create
end

Adding a deb repository

To configure a Cloudsmith repository for deb packages using Chef, you use the Chef apt_repository resource.

Example apt_repository resource configurations:

Public Repository

apt_repository 'Cloudsmith' do
  uri          'https://dl.cloudsmith.io/public/OWNER/REPOSITORY/deb/DISTRO'
  arch         'ARCH'
  distribution 'VERSION'
  components   ['main']
  key          'https://dl.cloudsmith.io/public/OWNER/REPOSITORY/cfg/gpg/gpg.FINGERPRINT.key'
end

Private Repository

apt_repository 'Cloudsmith' do
  uri          'https://dl.cloudsmith.io/TOKEN/OWNER/REPOSITORY/deb/DISTRO'
  arch         'ARCH'
  distribution 'VERSION'
  components   ['main']
  key          'https://dl.cloudsmith.io/TOKEN/OWNER/REPOSITORY/cfg/gpg/gpg.FINGERPRINT.key'
end
apt_repository 'Cloudsmith' do
  uri          'https://USERNAME:[email protected]/basic/OWNER/REPOSITORY/deb/DISTRO'
  arch         'ARCH'
  distribution 'VERSION'
  components   ['main']
  key          'https://USERNAME:[email protected]/basic/OWNER/REPOSITORY/cfg/gpg/gpg.FINGERPRINT.key'
end
apt_repository 'Cloudsmith' do
  uri          'https://USERNAME:[email protected]/basic/OWNER/REPOSITORY/deb/DISTRO'
  arch         'ARCH'
  distribution 'VERSION'
  components   ['main']
  key          'https://USERNAME:[email protected]/basic/OWNER/REPOSITORY/cfg/gpg/gpg.FINGERPRINT.key'
end
apt_repository 'Cloudsmith' do
  uri          'https://token:[email protected]/basic/OWNER/REPOSITORY/deb/DISTRO'
  arch         'ARCH'
  distribution 'VERSION'
  components   ['main']
  key          'https://token:[email protected]/basic/OWNER/REPOSITORY/cfg/gpg/gpg.FINGERPRINT.key'
end

Additional Formats

Chef Examples for additional package formats will be coming soon.

Updated 23 days ago


Chef


How to integrate Chef with Cloudsmith

Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.