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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
|
# File 'manifests/server.pp', line 31
class yum::server (
String $contact_email = 'root@localhost',
Stdlib::Absolutepath $docroot = '/opt/repos',
String $gpg_keys_path = 'keys', # gpg_keys_path is relative to $docroot, ${docroot}/${gpg_keys_path}
String $gpg_user_name = 'Root',
String $servername = 'yum',
Array[String, 1] $serveraliases = [ $::fqdn, $::hostname ],
Stdlib::IP::Address::Nosubnet $http_listen_ip = $::ipaddress,
) {
include ::apache
package { 'createrepo':
ensure => installed,
}
package { 'hardlink':
ensure => installed,
}
file { 'gpg_keys_dir':
ensure => directory,
path => "${docroot}/${gpg_keys_path}",
recurse => true,
owner => 'root',
group => 'root',
mode => '0644',
require => "Exec[mkdir_p-${docroot}]",
}
# needed for signing packages
file { 'dot_rpmmacros':
ensure => file,
path => '/root/.rpmmacros',
content => template('yum/rpmmacros.erb'),
owner => 'root',
group => 'root',
mode => '0644',
}
exec { "mkdir_p-${docroot}":
command => "mkdir -p ${docroot}",
unless => "test -d ${docroot}",
path => '/bin:/usr/bin',
}
apache::vhost { 'yumrepo':
docroot => $docroot,
port => '80',
vhost_name => $http_listen_ip,
servername => $servername,
serveraliases => $serveraliases,
serveradmin => $contact_email,
options => ['Indexes','FollowSymLinks','MultiViews'],
override => ['AuthConfig'],
require => "Exec[mkdir_p-${docroot}]",
}
}
|