Forge Home

reprepro

Assists in the creation of reprepro-based repositories

31,035 downloads

15,779 latest version

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

Support the Puppet Community by contributing to this module

You are welcome to contribute to this module by suggesting new features, currency updates, or fixes. Every contribution is valuable to help ensure that the module remains compatible with the latest Puppet versions and continues to meet community needs. Complete the following steps:

  1. Review the module’s contribution guidelines and any licenses. Ensure that your planned contribution aligns with the author’s standards and any legal requirements.
  2. Fork the repository on GitHub, make changes on a branch of your fork, and submit a pull request. The pull request must clearly document your proposed change.

For questions about updating the module, contact the module’s author.

Version information

  • 1.6.1 (latest)
  • 1.6.0
  • 1.5.0
  • 1.4.0
  • 1.3.0
  • 1.2.0
  • 1.0.5
  • 1.0.4
  • 1.0.3
  • 1.0.2
  • 1.0.1
  • 1.0.0
  • 0.5.0
  • 0.4.0
  • 0.3.0
  • 0.2.0
released Jun 11th 2015

Start using this module

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

Add this module to your Puppetfile:

mod 'jtopjian-reprepro', '1.6.1'
Learn more about managing modules with a Puppetfile

Add this module to your Bolt project:

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

Manually install this module globally with Puppet module tool:

puppet module install jtopjian-reprepro --version 1.6.1

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

jtopjian/reprepro — version 1.6.1 Jun 11th 2015

puppet reprepro module

Warning

This module is no longer actively maintained. If you'd like to take over maintenance, please let me know. Patches may continue to be merged for the time being, but will take longer than usual.

This module assists with creating a local apt repository.

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':
  ensure  => present,
  basedir => $basedir,
  options => ['basedir .'],
}

# Create a distribution within that repository
reprepro::distribution { 'precise':
  basedir       => $basedir,
  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':
  ensure  => present,
  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,
}

Credits

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