- add repositories for ovirt - add role/profile for ovirt/engine and ovirt/node - add deep-merge for managed_repos - change repos to allow filesource (URL or file://) - change reposync to use curl instead of wget
53 lines
1.6 KiB
Puppet
53 lines
1.6 KiB
Puppet
# define to generate repositories in yum
|
|
define profiles::reposync::repos (
|
|
String $repository,
|
|
String $description,
|
|
String $osname,
|
|
String $release,
|
|
Stdlib::Filesource $gpgkey,
|
|
String $arch = 'x86_64',
|
|
String $repo_owner = 'root',
|
|
String $repo_group = 'root',
|
|
Stdlib::Absolutepath $basepath = '/data/repos',
|
|
Optional[Stdlib::HTTPUrl] $baseurl = undef,
|
|
Optional[Stdlib::HTTPUrl] $mirrorlist = undef,
|
|
){
|
|
|
|
if ($mirrorlist == undef and $baseurl == undef) or ($mirrorlist != undef and $baseurl != undef) {
|
|
fail('profiles::reposync::repos must have either mirrorlist or baseurl set, but not both')
|
|
}
|
|
|
|
$repos_name = downcase("${osname}-${release}-${repository}-${arch}")
|
|
$conf_file = "/etc/reposync/conf.d/${repos_name}.conf"
|
|
|
|
# Create the repository configuration
|
|
yumrepo { $repos_name:
|
|
ensure => 'present',
|
|
descr => $description,
|
|
baseurl => $baseurl,
|
|
mirrorlist => $mirrorlist,
|
|
gpgkey => $gpgkey,
|
|
target => '/etc/yum.repos.d/reposync.repo',
|
|
enabled => 0,
|
|
gpgcheck => 1,
|
|
}
|
|
|
|
# Ensure the repo dest path exists
|
|
file { "${basepath}/live/${repos_name}" :
|
|
ensure => 'directory',
|
|
owner => $repo_owner,
|
|
group => $repo_group,
|
|
mode => '0755',
|
|
}
|
|
|
|
# Create the repo configuration file
|
|
file { $conf_file:
|
|
ensure => file,
|
|
owner => $repo_owner,
|
|
group => $repo_group,
|
|
mode => '0644',
|
|
content => template('profiles/reposync/repo_conf.erb'),
|
|
require => File['/etc/reposync/conf.d'],
|
|
}
|
|
}
|