Defined Type: aptly::repo

Defined in:
manifests/repo.pp

Summary

aptly::repo Create a repository using `aptly create`. It will not snapshot, or update the repository for you, because it will take a long time and it doesn't make sense to schedule these actions frequently in Puppet.

Overview

Parameters:

  • architectures (Array) (defaults to: [])

    Specify the list of supported architectures as an Array. If ommited Aptly assumes the repository.

  • comment (Optional[String[1]]) (defaults to: undef)

    Specifiy a comment to be set for the repository.

  • component (Optional[String[1]]) (defaults to: undef)

    Specify which component to put the package in. This option will only works for aptly version >= 0.5.0.

  • distribution (Optional[String[1]]) (defaults to: undef)

    Specify the default distribution to be used when publishing this repository.



13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# File 'manifests/repo.pp', line 13

define aptly::repo (
  Array $architectures = [],
  Optional[String[1]] $comment       = undef,
  Optional[String[1]] $component     = undef,
  Optional[String[1]] $distribution  = undef,
) {
  include aptly

  $aptly_cmd = "${aptly::aptly_cmd} repo"

  if empty($architectures) {
    $architectures_arg = ''
  } else {
    $architectures_as_s = join($architectures, ',')
    $architectures_arg = "-architectures=\"${architectures_as_s}\""
  }

  $comment_arg = if $comment {
    "-comment=\"${comment}\""
  } else {
    ''
  }

  $component_arg = if $component {
    "-component=\"${component}\""
  } else {
    ''
  }

  $distribution_arg = if $distribution {
    "-distribution=\"${distribution}\""
  } else {
    ''
  }

  exec { "aptly_repo_create-${title}":
    command => "${aptly_cmd} create ${architectures_arg} ${comment_arg} ${component_arg} ${distribution_arg} ${title}",
    unless  => "${aptly_cmd} show ${title} >/dev/null",
    user    => $aptly::user,
    require => [
      Package['aptly'],
      File['/etc/aptly.conf'],
    ],
  }
}