1
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
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
59
60
61
62
|
# File 'manifests/repo.pp', line 1
class varnish::repo(
$ensure = 'present',
$source = $::osfamily ? {
'Debian' => 'varnish-cache',
'RedHat' => 'varnish-cache',
},
) {
if defined(Class['varnish::install']) {
Class['varnish::repo'] -> Class['varnish::install']
}
case $::osfamily {
'Debian': {
case $source {
'distro': {
}
'varnish-cache': {
include ::apt
apt::source { 'varnish':
ensure => $ensure,
location => 'http://repo.varnish-cache.org/debian',
repos => 'varnish-4.0',
key => 'E98C6BBBA1CBC5C3EB2DF21C60E7C096C4DEFFEB',
key_source => 'http://repo.varnish-cache.org/debian/GPG-key.txt',
}
}
default: {
fail 'Repository source must be one of "distro" or "varnish-cache"'
}
}
}
'Redhat': {
yumrepo {'epel':
descr => "Extra Packages for Enterprise Linux ${::operatingsystemmajrelease} - \$basearch",
baseurl => "http://download.fedoraproject.org/pub/epel/${::operatingsystemmajrelease}/\$basearch",
enabled => 1,
gpgkey => "http://download.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-${::operatingsystemmajrelease}",
gpgcheck => 1,
}
case $source {
'epel': {
}
'varnish-cache': {
yumrepo { 'varnish':
ensure => $ensure,
descr => 'varnish',
baseurl => "http://repo.varnish-cache.org/redhat/varnish-4.0/el${::operatingsystemmajrelease}/\$basearch",
enabled => '1',
gpgcheck => '1',
gpgkey => 'http://repo.varnish-cache.org/debian/GPG-key.txt',
}
}
default: {
fail 'Repository source must be one of "epel" or "varnish-cache"'
}
}
}
default: {
fail "Unsupported Operating System family: ${::osfamily}"
}
}
}
|