Created
July 8, 2016 11:28
-
-
Save lukeab/d3c204b2bf6b48735feb10f3a0e7f5b7 to your computer and use it in GitHub Desktop.
messing with managed repo resource
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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