Puppet Class: icinga::repos::apt

Defined in:
manifests/repos/apt.pp

Summary

Manage repositories via `apt`.

Overview



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
31
32
33
34
35
36
37
# File 'manifests/repos/apt.pp', line 6

class icinga::repos::apt {

  assert_private()

  $repos   = $::icinga::repos::list
  $managed = $::icinga::repos::managed

  $configure_backports = $::icinga::repos::configure_backports

  include ::apt

  if $configure_backports {
    include ::apt::backports
    Apt::Source['backports'] -> Package <| |>
  }

  # fix issue 21, 33
  file { ['/etc/apt/sources.list.d/netways-plugins.list', '/etc/apt/sources.list.d/netways-extras.list']:
    ensure => 'absent',
  }

  $repos.each |String $repo_name, Hash $repo_config| {
    if $managed[$repo_name] {
      Apt::Source[$repo_name] -> Package <| |>
      apt::source { $repo_name:
        *       =>  merge({ ensure => present }, $repo_config),
        require => File['/etc/apt/sources.list.d/netways-plugins.list', '/etc/apt/sources.list.d/netways-extras.list'],
      }
    }
  }

}