Forge Home

reprepro

Puppet module to create apt repositories with reprepro

2,085 downloads

227 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 Jun 7th 2021
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.0.2'
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.0.2

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.0.2 Jun 7th 2021

reprepro puppet module

Build Status Puppet Forge Puppet Forge Puppet Forge Puppet Forge

Table of Contents

  1. Overview
  2. Usage
  3. Reference
  4. Contribuiting

Overview

This module assists with creating a local apt repository.

Usage

The only use-case it has been tested with has been to create a repository of pre-built packages. For example, I create a local repository of Puppet 2.7.x packages by downloading them from the official Puppet repository and then adding them to my local repo.

A Full Example

Using Puppet to create GPG keys is a bit complicated -- for example, the Puppet run could time out before the key is actually made. Because of this, I recommend creating the key manually:

$ su - reprepro
$ gpg --gen-key

# Configure as necessary.
# Note that you will have to maintain reprepro manually if you
# choose to use a passphrase.

$ gpg --export --armor foo@bar.com > /etc/puppet/modules/reprepro/files/localpkgs.gpg

# Alternatively, you can run the above commands as root and then later
# copy them to the reprepro user's home directory. This is a way to get
# around the chicken-and-egg scenario of having to create a key owned
# by a user that won't exist until after using the reprepro module.

The following is a full-stack example. This will create a reprepro-based repository, configure apache to allow access to the repository via http, and install the repository to your local apt configuration.

Once this is all set up, you can then add packages to ${basedir}/${repository}/tmp/${name}. reprepro will install packages left in that directory into the repository every 5 minutes via cron.

# Base Directory shortcut
$basedir = '/var/lib/apt/repo'

# 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     => 'F4D5DAA8',
  not_automatic => 'No',
}

# 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',
  require        => Reprepro::Distribution['precise'],
}

# Ensure your public key is accessible to download
file { '/var/lib/apt/repo/localpkgs/localpkgs.gpg':
  owner   => 'www-data',
  group   => 'reprepro',
  mode    => '0644',
  source  => 'puppet:///modules/reprepro/localpkgs.gpg',
  require => Apache::Vhost['localpkgs'],
}

# Set up an apt repo
apt::source { 'localpkgs':
  location    => 'http://apt.example.com',
  release     => 'precise',
  repos       => 'main contrib non-free',
  key         => 'F4D5DAA8',
  key_source  => 'http://apt.example.com/localpkgs.gpg',
  require     => File['/var/lib/apt/repo/localpkgs/localpkgs.gpg'],
  include_src => false,
}

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 / 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.