Revision c289176c
Added by Ohad Levy about 14 years ago
- ID c289176c6e4936c79ab0649a421188d9ed2d3bb3
lib/family.rb | ||
---|---|---|
FAMILIES.map{|e| OpenStruct.new(:name => e, :value => FAMILIES.index(e)) }
|
||
end
|
||
|
||
def media_uri host
|
||
URI.parse(host.media.path.gsub('$arch',host.architecture.name).
|
||
gsub('$major', host.os.major).
|
||
gsub('$minor', host.os.minor).
|
||
gsub('$version', [ host.os.major, host.os.minor ].compact.join('.'))
|
||
).normalize
|
||
def media_uri host, url = nil
|
||
url ||= host.media.path
|
||
URI.parse(url.gsub('$arch',host.architecture.name).
|
||
gsub('$major', host.os.major).
|
||
gsub('$minor', host.os.minor).
|
||
gsub('$version', [ host.os.major, host.os.minor ].compact.join('.'))
|
||
).normalize
|
||
end
|
||
|
||
module Debian
|
||
... | ... | |
end
|
||
end
|
||
|
||
def epel arch
|
||
["4","5"].include?(major) ? "su -c 'rpm -Uvh http://download.fedora.redhat.com/pub/epel/#{major}/#{arch}/epel-release-#{to_version}.noarch.rpm'" : ""
|
||
# installs the epel repo
|
||
def epel host
|
||
epel_url = "http://download.fedora.redhat.com/pub/epel/$major/$arch/epel-release-$os.noarch.rpm"
|
||
|
||
case host.operatingsystem.major
|
||
when "4"
|
||
epel_url.gsub!("$os","4-9")
|
||
when "5"
|
||
epel_url.gsub!("$os","5-3")
|
||
else
|
||
return ""
|
||
end
|
||
return "su -c 'rpm -Uvh #{media_uri(host, epel_url)}"
|
||
end
|
||
|
||
def yumrepo host
|
Also available in: Unified diff
fixes #237 - installing puppet from epel breaks if base image is not 5.3 or 4.9 release