Forge Home

reprepro

Puppet module to create apt repositories with reprepro

2,182 downloads

286 latest version

5.0 quality score

We run a couple of automated
scans to help you access a
module's quality. Each module is
given a score based on how well
the author has formatted their
code and documentation and
modules are also checked for
malware using VirusTotal.

Please note, the information below
is for guidance only and neither of
these methods should be considered
an endorsement by Puppet.

Version information

  • 4.1.0 (latest)
  • 4.0.4
  • 4.0.3
  • 4.0.2
released Mar 13th 2023
This version is compatible with:
  • Puppet Enterprise 2023.2.x, 2023.1.x, 2023.0.x, 2021.7.x, 2021.6.x, 2021.5.x, 2021.4.x, 2021.3.x, 2021.2.x, 2021.1.x, 2021.0.x, 2019.8.x, 2019.7.x, 2019.5.x, 2019.4.x, 2019.3.x, 2019.2.x, 2019.1.x, 2019.0.x, 2018.1.x, 2017.3.x, 2017.2.x, 2016.4.x
  • Puppet >= 4.10.0 < 8.0.0
  • ,

Start using this module

  • r10k or Code Manager
  • Bolt
  • Manual installation
  • Direct download

Add this module to your Puppetfile:

mod 'cirrax-reprepro', '4.1.0'
Learn more about managing modules with a Puppetfile

Add this module to your Bolt project:

bolt module add cirrax-reprepro
Learn more about using this module with an existing project

Manually install this module globally with Puppet module tool:

puppet module install cirrax-reprepro --version 4.1.0

Direct download is not typically how you would use a Puppet module to manage your infrastructure, but you may want to download the module in order to inspect the code.

Download

Documentation

cirrax/reprepro — version 4.1.0 Mar 13th 2023

reprepro puppet module

Build Status Puppet Forge Puppet Forge Puppet Forge Puppet Forge

Table of Contents

  1. Overview
  2. Usage
  3. PGP signing
  4. Reference
  5. Contribuiting
  6. Authors and Credits

Overview

This module assists with creating a local apt repository using reprepro.

Usage

Supports the followin usecases:

  • create a local repository for uploading packages with dput
  • create a local mirror of a repository (or part of a repository) eg. mirror of puppet packages from Puppetlabs.

Example usage with hiera

This example creates a private repository and start apache to provide the apt repositories.

include reprepro
include apache::vhosts
reprepro::distributions_defaults:
  architectures: 'amd64 source'
  components: 'main'
  deb_indices: 'Packages Release . .gz .bz2 .xz'
  dsc_indices: 'Sources Release . .gz .bz2 .xz'
  # sign_with: '000000KEYID00000'  # see chapter PGP signing
  install_cron: false
  not_automatic: 'yes'

# create one or more repositories:
reprepro::repositories:
  localpkgs:
    options:
      - 'basedir .'
    distributions:
      local:
        origin: 'my-packages'
        description: 'whatever the description should describe'
        label: 'my-packages'
        suite: 'local'

apache::vhosts::vhosts:
  apt.example.com:
    port: '80'
    servername: apt.example.com
    docroot: '/var/www/apt.example.com'

Example usage as puppet manifest

This example creates a private repository and start apache to provide the apt repositories.

# Main reprepro class
class { 'reprepro':
  basedir => $basedir,
}

# Set up a repository
reprepro::repository { 'localpkgs':
  options => ['basedir .'],
}

# Create a distribution within that repository
reprepro::distribution { 'precise':
  repository    => 'localpkgs',
  origin        => 'Foobar',
  label         => 'Foobar',
  suite         => 'precise',
  architectures => 'amd64 i386',
  components    => 'main contrib non-free',
  description   => 'Package repository for local site maintenance',
  # sign_with   => '000000KEYID00000'  # see chapter PGP signing
  not_automatic => 'No',
  install_cron  => false,
}

# Set up apache
class { 'apache': }

# Make your repo publicly accessible
apache::vhost { 'localpkgs':
  port           => '80',
  docroot        => '/var/lib/apt/repo/localpkgs',
  manage_docroot => false,
  servername     => 'apt.example.com',
}

PGP signing

If you like to use PGP (and you should do that !) to let reprepro sign the contents of your repositories you have to create and install the PGP key to use manually. The following shell commands show howto create a PGP key for reprepro:

# become the reprepro user:
$ su - reprepro

# Create a pgp key:
$ gpg --gen-key --pinentry-mode loopback

Note: if you protect your key with a passphrase, you have to manage packages manually in order to enter the passphrase.

Note2: --pinentry-mode loopback is needed since we used su to become the reprepro user.

By referencing the key ID with the parameter sign_with of the distribution resources, reprepro will use the key to sign.

Reference

All classes and reources are documented in theire respective code file. For information on classes, types and functions see the REFERENCE.md

Contributing

Please report bugs and feature request using GitHub issue tracker.

For pull requests, it is very much appreciated to check your Puppet manifest with puppet-lint and the available spec tests in order to follow the recommended Puppet style guidelines from the Puppet Labs style guide.

Authors and Credits

This module was based off of the existing work done by saz, camptocamp and desc.

See the list of contributors for a list of all contributors.