Puppet Class: aptly

Defined in:
manifests/init.pp

Summary

aptly is a swiss army knife for Debian repository management

Overview

Parameters:

  • package_ensure (String) (defaults to: 'present')

    Ensure parameter to pass to the package resource.

  • config_file (Stdlib::Absolutepath) (defaults to: '/etc/aptly.conf')

    Absolute path to the configuration file. Defaults to

  • config_contents (Optional[String]) (defaults to: undef)

    Contents of the config file.

  • config (Hash) (defaults to: {})

    Hash of configuration options for ‘/etc/aptly.conf`. See www.aptly.info/#configuration

  • repo (Boolean) (defaults to: true)

    Whether to configure an apt::source for ‘repo.aptly.info`. You might want to disable this when you’ve mirrored that yourself.

  • key_server (String) (defaults to: 'keyserver.ubuntu.com')

    Key server to use when ‘$repo` is true.

  • user (String) (defaults to: 'root')

    The user to use when performing an aptly command

  • aptly_repos (Hash) (defaults to: {})

    Hash of aptly repos which is passed to aptly::repo

  • aptly_mirrors (Hash) (defaults to: {})

    Hash of aptly mirrors which is passed to aptly::mirror



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
58
# File 'manifests/init.pp', line 14

class aptly (
  String $package_ensure            = 'present',
  Stdlib::Absolutepath $config_file = '/etc/aptly.conf',
  Hash $config                      = {},
  Optional[String] $config_contents = undef,
  Boolean $repo                     = true,
  String $key_server                = 'keyserver.ubuntu.com',
  String $user                      = 'root',
  Hash $aptly_repos                 = {},
  Hash $aptly_mirrors               = {},
) {
  if $repo {
    apt::source { 'aptly':
      location => 'http://repo.aptly.info',
      release  => 'squeeze',
      repos    => 'main',
      key      => {
        server => $key_server,
        id     => '78D6517AB92E22947F577996A0546A43624A8331',
      },
    }

    Apt::Source['aptly'] -> Class['apt::update'] -> Package['aptly']
  }

  package { 'aptly':
    ensure  => $package_ensure,
  }

  $config_file_contents = $config_contents ? {
    undef   => $config.stdlib::to_json_pretty,
    default => $config_contents,
  }

  file { $config_file:
    ensure  => file,
    content => $config_file_contents,
  }

  $aptly_cmd = "/usr/bin/aptly -config ${config_file}"

  # Hiera support
  create_resources('::aptly::repo', $aptly_repos)
  create_resources('::aptly::mirror', $aptly_mirrors)
}