Skip to content

Instantly share code, notes, and snippets.

@lukeab
Created July 8, 2016 11:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lukeab/d3c204b2bf6b48735feb10f3a0e7f5b7 to your computer and use it in GitHub Desktop.
Save lukeab/d3c204b2bf6b48735feb10f3a0e7f5b7 to your computer and use it in GitHub Desktop.
messing with managed repo resource
define repomanage::create_repo(
$baseurl=false,
$description=false,
$mirrorlist=false,
$proxy = false,
$priority = 1,
$enabled = 1
){
#notice("adding",$baseurl,"with proxy",$proxy,"and options: enabled=",$enabled," description:",$description," priority:",$priority)
$options = {
enabled => "$enabled",
gpgcheck => '0',
metadata_expire => '1',
protect => '0',
priority => "$priority",
}
if ($proxy) {
$options['proxy'] = "$proxy"
}
if ($baseurl) {
$options['baseurl'] = "$baseurl"
}
if ($description) {
$options['descr'] = "$description"
}
if ($mirrorlist) {
$options['mirrorlist'] = "$mirrorlist"
}
$params = { "$name" => $options }
create_resources(yumrepo, $params )
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment