Defined Type: aptly::repo

Defined in:
modules/aptly/manifests/repo.pp

Overview

SPDX-License-Identifier: Apache-2.0

Parameters:

  • distribution (String[1]) (defaults to: $title)
  • component (String[1]) (defaults to: 'main')
  • publish (Boolean) (defaults to: false)
  • user (String[1]) (defaults to: 'root')


2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'modules/aptly/manifests/repo.pp', line 2

define aptly::repo (
    String[1] $distribution = $title,
    String[1] $component    = 'main',
    Boolean   $publish      = false,
    String[1] $user         = 'root',
) {
    require aptly

    exec { "create-aptly-repo-${title}":
        command => "/usr/bin/aptly repo create -component=${component} -distribution=${distribution} ${title}",
        unless  => "/usr/bin/aptly repo show ${title} > /dev/null",
        user    => $user,
        cwd     => '/',
    }

    if $publish {
        # Pubish the repo directly, without snapshots
        # This isn't reccomended by aptly for production uses, but is perfect for labs :D
        exec { "publish-aptly-repo-${title}":
            command => "/usr/bin/aptly -architectures=amd64,all -skip-signing -origin=Wikimedia -label='${title}' -distribution='${title}' -component='${component}' publish repo ${title}",
            unless  => "/usr/bin/aptly publish list | /bin/grep -F '[${title}]' > /dev/null",
            user    => $user,
            cwd     => '/',
            require => Exec["create-aptly-repo-${title}"],
        }
    }
}