diff --git a/mongodb-debs/recipes/repo.rb b/mongodb-debs/recipes/repo.rb index ec76208..72fa8b1 100644 --- a/mongodb-debs/recipes/repo.rb +++ b/mongodb-debs/recipes/repo.rb @@ -20,6 +20,17 @@ return unless ["ubuntu", "debian"].include?(node[:platform]) +case node["platform"] +when "ubuntu" + if (8.04..9.04).include?(node["platform_version"].to_f) + apt_repo = "mongodb.list.sysvinit.erb" + else + apt_repo = "mongodb.list.upstart.erb" + end +when "debian" + apt_repo = "mongodb.list.sysvinit.erb" +end + execute "request mongodb key" do command "gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 7F0CEB10" not_if "gpg --list-keys 7F0CEB10" @@ -31,6 +42,7 @@ end template "/etc/apt/sources.list.d/mongodb.list" do + source apt_repo mode 0644 end diff --git a/mongodb-debs/templates/debian/mongodb.list.erb b/mongodb-debs/templates/default/mongodb.list.sysvinit.erb similarity index 100% rename from mongodb-debs/templates/debian/mongodb.list.erb rename to mongodb-debs/templates/default/mongodb.list.sysvinit.erb diff --git a/mongodb-debs/templates/ubuntu-10.04/mongodb.list.erb b/mongodb-debs/templates/default/mongodb.list.upstart.erb similarity index 100% rename from mongodb-debs/templates/ubuntu-10.04/mongodb.list.erb rename to mongodb-debs/templates/default/mongodb.list.upstart.erb diff --git a/mongodb-debs/templates/ubuntu-10.10/mongodb.list.erb b/mongodb-debs/templates/ubuntu-10.10/mongodb.list.erb deleted file mode 100644 index 29aba9b..0000000 --- a/mongodb-debs/templates/ubuntu-10.10/mongodb.list.erb +++ /dev/null @@ -1 +0,0 @@ -deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen diff --git a/mongodb-debs/templates/ubuntu-11.04/mongodb.list.erb b/mongodb-debs/templates/ubuntu-11.04/mongodb.list.erb deleted file mode 100644 index 29aba9b..0000000 --- a/mongodb-debs/templates/ubuntu-11.04/mongodb.list.erb +++ /dev/null @@ -1 +0,0 @@ -deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen diff --git a/mongodb-debs/templates/ubuntu-11.10/mongodb.list.erb b/mongodb-debs/templates/ubuntu-11.10/mongodb.list.erb deleted file mode 100755 index 29aba9b..0000000 --- a/mongodb-debs/templates/ubuntu-11.10/mongodb.list.erb +++ /dev/null @@ -1 +0,0 @@ -deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen diff --git a/mongodb-debs/templates/ubuntu-12.04/mongodb.list.erb b/mongodb-debs/templates/ubuntu-12.04/mongodb.list.erb deleted file mode 100755 index 29aba9b..0000000 --- a/mongodb-debs/templates/ubuntu-12.04/mongodb.list.erb +++ /dev/null @@ -1 +0,0 @@ -deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen diff --git a/mongodb-debs/templates/ubuntu-9.04/mongodb.list.erb b/mongodb-debs/templates/ubuntu-9.04/mongodb.list.erb deleted file mode 100644 index d4122aa..0000000 --- a/mongodb-debs/templates/ubuntu-9.04/mongodb.list.erb +++ /dev/null @@ -1 +0,0 @@ -deb http://downloads.mongodb.org/distros/ubuntu 9.4 10gen diff --git a/mongodb-debs/templates/ubuntu-9.10/mongodb.list.erb b/mongodb-debs/templates/ubuntu-9.10/mongodb.list.erb deleted file mode 100644 index f3774e3..0000000 --- a/mongodb-debs/templates/ubuntu-9.10/mongodb.list.erb +++ /dev/null @@ -1 +0,0 @@ -deb http://downloads.mongodb.org/distros/ubuntu 9.10 10gen