Puppet Class: icinga::repos::yum

Defined in:
manifests/repos/yum.pp

Summary

Manage repositories via `yum`.

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
# File 'manifests/repos/yum.pp', line 6

class icinga::repos::yum {
  assert_private()

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

  # EPEL package
  if !'epel' in keys($repos) and $managed['epel'] {
    warning("Repository EPEL isn't available on ${facts['os']['name']} ${facts['os']['release']['major']}.")
  }

  # PowerTools package
  if !'powertools' in keys($repos) and $managed['powertools'] {
    warning("Repository PowerTools isn't available on ${facts['os']['name']} ${facts['os']['release']['major']}.")
  }

  # CRB package
  if !'crb' in keys($repos) and $managed['crb'] {
    warning("Repository CRB isn't available on ${facts['os']['name']} ${facts['os']['release']['major']}.")
  }

  $repos.each |String $repo_name, Hash $repo_config| {
    if $repo_name in keys($managed) and $managed[$repo_name] {
      Yumrepo[$repo_name] -> Package <| tag == 'icinga' or tag == 'icinga2' or tag == 'icingadb' or tag == 'icingaweb2' |>
      yumrepo { $repo_name:
        * => $repo_config,
      }
    }
  }
}