Puppet
How to integrate Puppet with Cloudsmith
Puppet is open-core software for provisioning, configuration management, and application deployment. Puppet declaratively manages the configuration of Unix-like, macOS and Microsoft Windows systems.
- Puppet: Puppet Website
- Puppet Docs: Official Puppet documentation
In the following examples:
Identifier | Description |
---|---|
OWNER | Your Cloudsmith organisation name (namespace) |
REPOSITORY | Your Cloudsmith Repository identifier (also called "slug") |
DISTRO | Your distribution (i.e el, fedora, debian etc) |
VERSION | Your version name (i.e 7, 29, hardy, buster etc) |
FINGERPRINT-LONG | The 20 Byte fingerprint of the Public GPG key for the repository |
FINGERPRINT | The 8 Byte fingerprint of the Public GPG key for the repository |
TOKEN | Your Cloudsmith Entitlement Token (see Entitlements for more details) |
USERNAME | Your Cloudsmith username |
PASSWORD | Your Cloudsmith password |
API-KEY | Your Cloudsmith API Key |
PACKAGE | The name of the package |
Debian repository
Configuration
To add a Cloudsmith repository for Debian packages using Puppet, you would use the Puppet apt module .
Example Puppet Class using apt module:
Public Repository
class cloudsmith_repo {
include apt
apt::key { 'cloudsmith':
id => 'FINGERPRINT-LONG,
source => 'https://dl.cloudsmith.io/public/OWNER/REPOSITORY/cfg/gpg/gpg.FINGERPRINT.key',
}
apt::source { 'cloudsmith':
comment => 'A Description added to repo config in /etc/apt/sources.list.d/',
location => 'https://dl.cloudsmith.io/public/OWNER/REPOSITORY/deb/DISTRO',
release => 'VERSION',
repos => 'main',
pin => 500,
include => {
'src' => true,
'deb' => true,
},
}
}
Private Repository
class cloudsmith_repo {
include apt
apt::key { 'cloudsmith':
id => 'FINGERPRINT-LONG,
source => 'https://dl.cloudsmith.io/TOKEN/OWNER/REPOSITORY/cfg/gpg/gpg.FINGERPRINT.key',
}
apt::source { 'cloudsmith':
comment => 'A Description added to repo config in /etc/apt/sources.list.d/',
location => 'https://dl.cloudsmith.io/TOKEN/OWNER/REPOSITORY/deb/DISTRO',
release => 'VERSION',
repos => 'main',
pin => 500,
include => {
'src' => true,
'deb' => true,
},
}
}
class cloudsmith_repo {
include apt
apt::key { 'cloudsmith':
id => 'FINGERPRINT-LONG,
source => 'https://USERNAME:[email protected]/basic/OWNER/REPOSITORY/cfg/gpg/gpg.FINGERPRINT.key',
}
apt::source { 'cloudsmith':
comment => 'A Description added to repo config in /etc/apt/sources.list.d/',
location => 'https://USERNAME:[email protected]/basic/OWNER/REPOSITORY/deb/DISTRO',
release => 'VERSION',
repos => 'main',
pin => 500,
include => {
'src' => true,
'deb' => true,
},
}
}
class cloudsmith_repo {
include apt
apt::key { 'cloudsmith':
id => 'FINGERPRINT-LONG,
source => 'https://USERNAME:[email protected]/basic/OWNER/REPOSITORY/cfg/gpg/gpg.FINGERPRINT.key',
}
apt::source { 'cloudsmith':
comment => 'A Description added to repo config in /etc/apt/sources.list.d/',
location => 'https://USERNAME:[email protected]/basic/OWNER/REPOSITORY/deb/DISTRO',
release => 'VERSION',
repos => 'main',
pin => 500,
include => {
'src' => true,
'deb' => true,
},
}
}
class cloudsmith_repo {
include apt
apt::key { 'cloudsmith':
id => 'FINGERPRINT-LONG,
source => 'https://token:[email protected]/basic/OWNER/REPOSITORY/cfg/gpg/gpg.FINGERPRINT.key',
}
apt::source { 'cloudsmith':
comment => 'A Description added to repo config in /etc/apt/sources.list.d/',
location => 'https://token:[email protected]/basic/OWNER/REPOSITORY/deb/DISTRO',
release => 'VERSION',
repos => 'main',
pin => 500,
include => {
'src' => true,
'deb' => true,
},
}
}
Package Installation
After you have configured the repository, you can then install a package using:
package { 'PACKAGE':
ensure => 'latest',
}
Updated 4 months ago