Puppet Class: aptly::client

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

Overview

SPDX-License-Identifier: Apache-2.0

Parameters:

  • servername (Stdlib::Fqdn)
  • components (Array[String[1]]) (defaults to: ['main'])
  • protocol (Enum['http', 'https']) (defaults to: 'http')
  • auto_upgrade (Boolean) (defaults to: true)


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
29
30
# File 'modules/aptly/manifests/client.pp', line 2

class aptly::client (
    Stdlib::Fqdn          $servername,
    Array[String[1]]      $components   = ['main'],
    Enum['http', 'https'] $protocol     = 'http',
    Boolean               $auto_upgrade = true,
) {
    apt::repository { 'project-aptly':
        uri        => "${protocol}://${servername}/repo",
        dist       => "${::lsbdistcodename}-${::wmcs_project}",
        components => $components.join(' '),
        trust_repo => true,
        source     => false,
    }

    # Pin it so it has higher preference
    apt::pin { 'project-aptly':
        package  => '*',
        pin      => "origin ${servername}",
        priority => 1500,
    }

    apt::conf { 'unattended-upgrades-aptly':
        ensure   => $auto_upgrade.bool2str('present', 'absent'),
        priority => '52',
        # Key with trailing '::' to append to potentially existing entry
        key      => 'Unattended-Upgrade::Origins-Pattern::',
        value    => "site=${servername}",
    }
}