From c02c519052a03dc0781bc2c74ecf72447a674b4f Mon Sep 17 00:00:00 2001 From: Marius Ducea Date: Wed, 14 Nov 2012 13:20:51 -0800 Subject: [PATCH] rewrite the apt sources template files to include a sysvinit and another upstart version; this will no longer require any other changes for future versions of ubuntu (unless there is of course a new apt source for that) --- mongodb-debs/recipes/repo.rb | 12 ++++++++++++ .../mongodb.list.sysvinit.erb} | 0 .../mongodb.list.upstart.erb} | 0 mongodb-debs/templates/ubuntu-10.10/mongodb.list.erb | 1 - mongodb-debs/templates/ubuntu-11.04/mongodb.list.erb | 1 - mongodb-debs/templates/ubuntu-11.10/mongodb.list.erb | 1 - mongodb-debs/templates/ubuntu-12.04/mongodb.list.erb | 1 - mongodb-debs/templates/ubuntu-9.04/mongodb.list.erb | 1 - mongodb-debs/templates/ubuntu-9.10/mongodb.list.erb | 1 - 9 files changed, 12 insertions(+), 6 deletions(-) rename mongodb-debs/templates/{debian/mongodb.list.erb => default/mongodb.list.sysvinit.erb} (100%) rename mongodb-debs/templates/{ubuntu-10.04/mongodb.list.erb => default/mongodb.list.upstart.erb} (100%) delete mode 100644 mongodb-debs/templates/ubuntu-10.10/mongodb.list.erb delete mode 100644 mongodb-debs/templates/ubuntu-11.04/mongodb.list.erb delete mode 100755 mongodb-debs/templates/ubuntu-11.10/mongodb.list.erb delete mode 100755 mongodb-debs/templates/ubuntu-12.04/mongodb.list.erb delete mode 100644 mongodb-debs/templates/ubuntu-9.04/mongodb.list.erb delete mode 100644 mongodb-debs/templates/ubuntu-9.10/mongodb.list.erb 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