Puppet Class: mrepo::package
- Defined in:
- manifests/package.pp
Overview
This class installs mrepo from source or from the system package repository
Parameters
None
Examples
This class does not need to be directly included.
Author
Adrien Thebo <adrien@puppetlabs.com>
Copyright
Copyright 2011 Puppet Labs, unless otherwise noted
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 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 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 |
# File 'manifests/package.pp', line 19
class mrepo::package {
$user = $mrepo::user
$group = $mrepo::group
$source = $mrepo::source
$proto = $mrepo::git_proto
$ensure = $mrepo::ensure_src
case $source {
'git': {
vcsrepo { '/usr/src/mrepo':
ensure => $ensure,
revision => 'HEAD',
provider => 'git',
source => "${proto}://github.com/dagwieers/mrepo.git",
}
exec { 'Install mrepo from source':
refreshonly => true,
path => '/usr/bin:/usr/sbin:/sbin:/bin',
cwd => '/usr/src/mrepo',
refresh => 'make install',
subscribe => Vcsrepo['/usr/src/mrepo'],
logoutput => on_failure,
}
}
'package': {
package { 'mrepo':
ensure => present,
}
}
default: {
}
}
# mrepo.conf template params
#
$src_root = $mrepo::src_root
$www_root = $mrepo::www_root
$rhn_username = $mrepo::rhn_username
$rhn_password = $mrepo::rhn_password
$rhnget_cleanup = $mrepo::rhnget_cleanup
$rhnget_download_all = $mrepo::rhnget_download_all
$mailto = $mrepo::mailto
$http_proxy = $mrepo::http_proxy
$https_proxy = $mrepo::https_proxy
$createrepo_options = $mrepo::createrepo_options
file { '/etc/mrepo.conf':
ensure => file,
owner => $user,
group => $group,
mode => '0640',
content => template('mrepo/mrepo.conf.erb'),
}
file { '/etc/mrepo.conf.d':
ensure => directory,
owner => $user,
group => $group,
mode => '0755',
}
file { '/var/cache/mrepo':
ensure => directory,
owner => $user,
group => $group,
mode => '0755',
}
file { $src_root:
ensure => directory,
owner => $user,
group => $group,
mode => '0755',
}
file { '/var/log/mrepo.log':
ensure => file,
owner => $user,
group => $group,
mode => '0640',
}
# Packages needed to mirror files and generate mirror metadata
package { ['lftp', 'createrepo']:
ensure => present,
}
}
|