Skip to content

Instantly share code, notes, and snippets.

@jtopjian
Created December 1, 2012 05:29
Show Gist options
  • Save jtopjian/4180686 to your computer and use it in GitHub Desktop.
Save jtopjian/4180686 to your computer and use it in GitHub Desktop.
Terrarum - apt infrastructure
class { 'acng::client':
server => 'apt.example.com',
}
class { 'acng::server': }
class { 'apache': }
apache::vhost { 'localpkgs':
port => '80',
docroot => '/var/lib/apt/repo/localpkgs',
servername => 'apt.example.com',
require => Reprepro::Distribution['precise'],
}
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'],
}
class { 'apt_mirror': }
apt_mirror::mirror { 'ubuntu precise':
mirror => 'archive.ubuntu.com',
os => 'ubuntu',
release => 'precise',
components => ['main', 'contrib'],
}
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',
include_src => false,
}
$basedir = '/var/lib/apt/repo'
class { 'reprepro':
basedir => $basedir,
}
reprepro::repository { 'localpkgs':
ensure => present,
basedir => $basedir,
options => ['basedir .'],
}
reprepro::distribution { 'precise':
basedir => $basedir,
repository => 'localpkgs',
origin => 'Foobar',
label => 'Foobar',
suite => 'stable',
architectures => 'amd64 i386',
components => 'main contrib non-free',
description => 'Package repository for local site maintenance',
sign_with => 'F4D5DAA8',
not_automatic => 'No',
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment