Permalink
Browse files

COOK-349, select URL with attributes

  • Loading branch information...
1 parent b3f8271 commit da3a5210c0bbaa7cfe343a092448a47bb0daedfc @jtimberman jtimberman committed Jan 30, 2011
Showing with 33 additions and 9 deletions.
  1. +24 −0 ubuntu/attributes/default.rb
  2. +2 −2 ubuntu/metadata.json
  3. +1 −1 ubuntu/metadata.rb
  4. +6 −6 ubuntu/templates/default/sources.list.erb
@@ -0,0 +1,24 @@
+#
+# Cookbook Name:: ubuntu
+# Attribute File:: default
+#
+# Copyright 2011, Opscode, Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+case platform
+when "ubuntu"
+ set[:ubuntu][:archive_url] = "http://us.archive.ubuntu.com/ubuntu"
+ set[:ubuntu][:security_url] = "http://security.ubuntu.com/ubuntu"
+end
View
@@ -20,7 +20,7 @@
]
},
"license": "Apache 2.0",
- "version": "0.8.1",
+ "version": "0.99.0",
"providing": {
},
"recipes": {
@@ -33,4 +33,4 @@
"groupings": {
},
"long_description": ""
- }
+ }
View
@@ -2,7 +2,7 @@
maintainer_email "cookbooks@opscode.com"
license "Apache 2.0"
description "Sets up sources for ubuntu"
-version "0.8.1"
+version "0.99.0"
depends "apt"
supports "ubuntu"
recipe "ubuntu", "Sets up sources for the node's ubuntu release"
@@ -2,14 +2,14 @@
# Ubuntu <%= @code_name %> - Generated by Chef
#
-deb http://us.archive.ubuntu.com/ubuntu <%= @code_name %> main restricted universe multiverse
-deb-src http://us.archive.ubuntu.com/ubuntu <%= @code_name %> main restricted universe multiverse
+deb <%= node['ubuntu']['archive_url'] %> <%= @code_name %> main restricted universe multiverse
+deb-src <%= node['ubuntu']['archive_url'] %> <%= @code_name %> main restricted universe multiverse
-deb http://us.archive.ubuntu.com/ubuntu <%= @code_name %>-updates main restricted universe multiverse
-deb-src http://us.archive.ubuntu.com/ubuntu <%= @code_name %>-updates main restricted universe multiverse
+deb <%= node['ubuntu']['archive_url'] %> <%= @code_name %>-updates main restricted universe multiverse
+deb-src <%= node['ubuntu']['archive_url'] %> <%= @code_name %>-updates main restricted universe multiverse
#
# Security updates
#
-deb http://security.ubuntu.com/ubuntu <%= @code_name %>-security main restricted universe multiverse
-deb-src http://security.ubuntu.com/ubuntu <%= @code_name %>-security main restricted universe multiverse
+deb <%= node['ubuntu']['security_url'] %> <%= @code_name %>-security main restricted universe multiverse
+deb-src <%= node['ubuntu']['security_url'] %> <%= @code_name %>-security main restricted universe multiverse

0 comments on commit da3a521

Please sign in to comment.