Instead of doing some crappy things, we are using the yum cookbook.
We do it this way. It avoids complexity and breaking tests.
This commit is contained in:
21
metadata.rb
21
metadata.rb
@@ -1,9 +1,12 @@
|
||||
name "ceph"
|
||||
maintainer "Kyle Bader"
|
||||
maintainer_email "kyle.bader@dreamhost.com"
|
||||
license "Apache 2.0"
|
||||
description "Installs/Configures the Ceph distributed filesystem"
|
||||
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
|
||||
version "0.1.0"
|
||||
depends "apache2", ">= 1.1.12"
|
||||
depends "apt"
|
||||
name "ceph"
|
||||
maintainer "Kyle Bader"
|
||||
maintainer_email "kyle.bader@dreamhost.com"
|
||||
license "Apache 2.0"
|
||||
description "Installs/Configures the Ceph distributed filesystem"
|
||||
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
|
||||
version "0.1.0"
|
||||
|
||||
depends "apache2", ">= 1.1.12"
|
||||
depends "apt"
|
||||
depends "yum", ">= 3.0"
|
||||
depends "yum-epel"
|
||||
|
||||
@@ -3,11 +3,7 @@ platform_family = node['platform_family']
|
||||
case platform_family
|
||||
when "rhel"
|
||||
if node['ceph']['el_add_epel'] == true
|
||||
# We need to do this since the EPEL
|
||||
# version might change
|
||||
version = node['platform_version'].to_i
|
||||
epel_package = %x[ curl -s http://dl.fedoraproject.org/pub/epel/fullfilelist | grep ^#{version}/#{node['kernel']['machine']}/epel-release ].chomp
|
||||
system "rpm -U http://dl.fedoraproject.org/pub/epel/#{epel_package}"
|
||||
include_recipe "yum_epel"
|
||||
end
|
||||
end
|
||||
|
||||
@@ -18,32 +14,14 @@ end
|
||||
|
||||
repo = node['ceph'][platform_family][branch]['repository']
|
||||
|
||||
if branch == "dev"
|
||||
# Instead of using the yum cookbook,
|
||||
# we do it this way. It avoids a dependency
|
||||
system "curl -s #{node['ceph'][platform_family]['dev']['repository_key']} > /etc/pki/rpm-gpg/RPM-GPG-KEY-CEPH"
|
||||
system "cat > /etc/yum.repos.d/ceph.repo << EOF\n" \
|
||||
"[ceph]\n" \
|
||||
"name=Ceph\n" \
|
||||
"baseurl=#{repo}\n" \
|
||||
"enabled=1\n" \
|
||||
"gpgcheck=1\n" \
|
||||
"gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CEPH\n" \
|
||||
"EOF\n"
|
||||
else
|
||||
# This is a stable or testing branch
|
||||
system "rpm -U #{node['ceph'][platform_family][branch]['repository']}"
|
||||
yum_repository "ceph" do
|
||||
baseurl repo
|
||||
gpgkey node['ceph'][platform_family]['dev']['repository_key'] if branch == "dev"
|
||||
end
|
||||
|
||||
if node['roles'].include?("ceph-tgt")
|
||||
repo = node['ceph'][platform_family]['extras']['repository']
|
||||
system "curl -s #{node['ceph'][platform_family]['extras']['repository_key']} > /etc/pki/rpm-gpg/RPM-GPG-KEY-CEPH-EXTRAS"
|
||||
system "cat > /etc/yum.repos.d/ceph.repo << EOF\n" \
|
||||
"[ceph]\n" \
|
||||
"name=Ceph\n" \
|
||||
"baseurl=#{repo}\n" \
|
||||
"enabled=1\n" \
|
||||
"gpgcheck=1\n" \
|
||||
"gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CEPH-EXTRAS\n" \
|
||||
"EOF\n"
|
||||
yum_repository "ceph-extra" do
|
||||
baseurl node['ceph'][platform_family]['extras']['repository']
|
||||
gpgkey node['ceph'][platform_family]['extras']['repository_key']
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user