[Go to site: main page, start]

Continuous Configuration Automation (CCA)

Integrating Puppet

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.

In the following examples:

IdentifierDescription
OWNERYour Cloudsmith organization name (namespace)
REPOSITORYYour Cloudsmith Repository identifier (also called "slug")
DISTROYour distribution (for example, el, fedora, or debian)
VERSIONYour version name (for example, 7, 29, hardy, or buster)
FINGERPRINT-LONGThe 20 Byte fingerprint of the Public GPG key for the repository
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
PACKAGEThe 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

text
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,
    },
  }
}
text
class cloudsmith_repo {

  include apt

  apt::key { 'cloudsmith':
    id      => 'FINGERPRINT-LONG,
    source  => 'https://USERNAME:PASSWORD@dl.cloudsmith.io/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:PASSWORD@dl.cloudsmith.io/basic/OWNER/REPOSITORY/deb/DISTRO',
    release  => 'VERSION',
    repos    => 'main',
    pin      => 500,
    include  => {
      'src' => true,
      'deb' => true,
    },
  }

}
text
class cloudsmith_repo {

  include apt

  apt::key { 'cloudsmith':
    id      => 'FINGERPRINT-LONG,
    source  => 'https://USERNAME:API-KEY@dl.cloudsmith.io/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:API-KEY@dl.cloudsmith.io/basic/OWNER/REPOSITORY/deb/DISTRO',
    release  => 'VERSION',
    repos    => 'main',
    pin      => 500,
    include  => {
      'src' => true,
      'deb' => true,
    },
  }
}
text
class cloudsmith_repo {

  include apt

  apt::key { 'cloudsmith':
    id      => 'FINGERPRINT-LONG,
    source  => 'https://token:TOKEN@dl.cloudsmith.io/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:TOKEN@dl.cloudsmith.io/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',
  }