From c49da7eab8efc3ad57eeb1630243d5c5e1399d30 Mon Sep 17 00:00:00 2001 From: Alexandre Marangone Date: Wed, 8 May 2013 11:32:02 -0700 Subject: [PATCH] repo: support custom apt repos Signed-off-by: Alexandre Marangone --- attributes/repo.rb | 6 ++++++ recipes/apt.rb | 33 ++++++++------------------------- 2 files changed, 14 insertions(+), 25 deletions(-) diff --git a/attributes/repo.rb b/attributes/repo.rb index 625f77c..961cc8a 100644 --- a/attributes/repo.rb +++ b/attributes/repo.rb @@ -2,3 +2,9 @@ default['ceph']['branch'] = "stable" # Can be stable, testing or dev. # Major release version to install or gitbuilder branch default['ceph']['version'] = "cuttlefish" default['ceph']['el_add_epel'] = true +default['ceph']['debian']['stable']['repository'] = "http://ceph.com/debian-#{node['ceph']['version']}/" +default['ceph']['debian']['stable']['repository_key'] = "https://ceph.com/git/?p=ceph.git;a=blob_plain;f=keys/release.asc" +default['ceph']['debian']['testing']['repository'] = "http://www.ceph.com/debian-testing/" +default['ceph']['debian']['testing']['repository_key'] = "https://ceph.com/git/?p=ceph.git;a=blob_plain;f=keys/release.asc" +default['ceph']['debian']['dev']['repository'] = "http://gitbuilder.ceph.com/ceph-deb-#{node['lsb']['codename']}-x86_64-basic/ref/#{node['ceph']['version']}" +default['ceph']['debian']['dev']['repository_key'] = "https://ceph.com/git/?p=ceph.git;a=blob_plain;f=keys/autobuild.asc" diff --git a/recipes/apt.rb b/recipes/apt.rb index 0b3dabe..769be10 100644 --- a/recipes/apt.rb +++ b/recipes/apt.rb @@ -1,29 +1,12 @@ include_recipe "apt" -case node['ceph']['branch'] -when "stable" - apt_repository "ceph-stable" do - repo_name "ceph" - uri "http://ceph.com/debian-#{node['ceph']['version']}/" - distribution node['lsb']['codename'] - components ["main"] - key "https://ceph.com/git/?p=ceph.git;a=blob_plain;f=keys/release.asc" - end -when "testing" - apt_repository "ceph-testing" do - repo_name "ceph" - uri "http://www.ceph.com/debian-testing/" - distribution node['lsb']['codename'] - components ["main"] - key "https://ceph.com/git/?p=ceph.git;a=blob_plain;f=keys/release.asc" - end -when "dev" - apt_repository "ceph-gitbuilder" do - repo_name "ceph" - uri "http://gitbuilder.ceph.com/ceph-deb-#{node['lsb']['codename']}-x86_64-basic/ref/#{node['ceph']['version']}" - distribution node['lsb']['codename'] - components ["main"] - key "https://ceph.com/git/?p=ceph.git;a=blob_plain;f=keys/autobuild.asc" - end +branch = node['ceph']['branch'] + +apt_repository "ceph-#{branch}" do + repo_name "ceph" + uri node['ceph']['debian'][branch]['repository'] + distribution node['lsb']['codename'] + components ['main'] + key node['ceph']['debian'][branch]['repository_key'] end