Puppet Class: psick::repo

Defined in:
manifests/repo.pp

Overview

Generic repo management wrapper class Repos to create, besides default ones (when use_defaults = true) are looked up via lookup

Parameters:

  • use_defaults (Boolean) (defaults to: true)
  • yum_resource (String) (defaults to: 'yumrepo')
  • yum_repos (Hash) (defaults to: {})
  • apt_resource (String) (defaults to: 'apt::source')
  • apt_repos (Hash) (defaults to: {})
  • zypper_resource (String) (defaults to: 'zypprepo')
  • zypper_repos (Hash) (defaults to: {})
  • manage (Boolean) (defaults to: $psick::manage)
  • noop_manage (Boolean) (defaults to: $psick::noop_manage)
  • noop_value (Boolean) (defaults to: $psick::noop_value)


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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# File 'manifests/repo.pp', line 5

class psick::repo (
  Boolean $use_defaults       = true,
  String $yum_resource        = 'yumrepo',     # Native resource type
  Hash $yum_repos             = {},
  String $apt_resource        = 'apt::source', # From puppetlabs-apt
  Hash $apt_repos             = {},
  String $zypper_resource     = 'zypprepo',    # From darin-zypprepo
  Hash $zypper_repos          = {},

  Boolean $manage             = $psick::manage,
  Boolean $noop_manage        = $psick::noop_manage,
  Boolean $noop_value         = $psick::noop_value,

) {
  if $manage {
    if $noop_manage {
      noop($noop_value)
    }

    # Default repos
    if $use_defaults {
      case $facts['os']['family'] {
        'RedHat': {
          tp::repo { 'epel': }
        }
        'Debian': {
        }
        'Suse': {
        }
        default: {
        }
      }
    }

    # Not converted to Puppet 4 style for easier variables management.
    if $yum_repos != {} {
      create_resources($yum_resource, $yum_repos)
    }
    if $apt_repos != {} {
      create_resources($apt_resource, $apt_repos)
    }
    if $yum_repos != {} {
      create_resources($zypper_resource, $yum_repos)
    }
  }
}