From c74c973dc5fcff898ca5f0fdeda54b3206f75b36 Mon Sep 17 00:00:00 2001 From: Howard Glynn Date: Mon, 25 Feb 2013 16:40:52 +0000 Subject: [PATCH 1/2] parameterizing bucket_location for wider non US use --- README.rdoc | 3 ++- attributes/default.rb | 5 ++++- templates/default/s3cfg.erb | 4 ++-- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/README.rdoc b/README.rdoc index f614c21..2b8bc5a 100644 --- a/README.rdoc +++ b/README.rdoc @@ -11,7 +11,8 @@ All node attributes are set under the :s3cmd namespace. * :users - array of usernames for whom a .s3cfg will be created in their home directory; defaults to [:root] * :aws_access_key_id - AWS access key for S3 * :aws_secret_access_key - AWS secret access key for S3 +* :bucket_location - AWS bucket location for S3; defaults to "US" = USAGE: -Just add the s3cmd recipe to the applicable nodes \ No newline at end of file +Just add the s3cmd recipe to the applicable nodes diff --git a/attributes/default.rb b/attributes/default.rb index 42bb637..0c3203b 100644 --- a/attributes/default.rb +++ b/attributes/default.rb @@ -1,10 +1,13 @@ # list of users that will have the s3cmd configuration default[:s3cmd][:users] = [:root] +# Bucket Location +default[:s3cmd][:bucket_location] = "US" + # S3 credentials default[:s3cmd][:aws_access_key_id] = "" default[:s3cmd][:aws_secret_access_key] = "" default[:s3cmd][:version] = "v1.1.0-beta3" default[:s3cmd][:user] = "root" -default[:s3cmd][:install_prefix_root] = "/usr/local" \ No newline at end of file +default[:s3cmd][:install_prefix_root] = "/usr/local" diff --git a/templates/default/s3cfg.erb b/templates/default/s3cfg.erb index d46a218..4e7cb3a 100644 --- a/templates/default/s3cfg.erb +++ b/templates/default/s3cfg.erb @@ -1,7 +1,7 @@ [default] access_key = <%= node[:s3cmd][:aws_access_key_id] %> acl_public = False -bucket_location = US +bucket_location = <%= node[:s3cmd][:bucket_location] %> cloudfront_host = cloudfront.amazonaws.com cloudfront_resource = /2008-06-30/distribution default_mime_type = binary/octet-stream @@ -32,4 +32,4 @@ simpledb_host = sdb.amazonaws.com skip_existing = False urlencoding_mode = normal use_https = False -verbosity = WARNING \ No newline at end of file +verbosity = WARNING From 07fc5f4c5c9c7bb64b95a50fcc90a0ee3b7cc72e Mon Sep 17 00:00:00 2001 From: Howard Glynn Date: Tue, 26 Feb 2013 08:57:35 +0000 Subject: [PATCH 2/2] parameterize repository to allow use of https or git protocol --- attributes/default.rb | 2 ++ recipes/default.rb | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/attributes/default.rb b/attributes/default.rb index 0c3203b..8c44e87 100644 --- a/attributes/default.rb +++ b/attributes/default.rb @@ -8,6 +8,8 @@ default[:s3cmd][:aws_access_key_id] = "" default[:s3cmd][:aws_secret_access_key] = "" +# s3cmd details +default[:s3cmd][:repository] = "git://github.com/s3tools/s3cmd.git" default[:s3cmd][:version] = "v1.1.0-beta3" default[:s3cmd][:user] = "root" default[:s3cmd][:install_prefix_root] = "/usr/local" diff --git a/recipes/default.rb b/recipes/default.rb index f78efb8..4ed6c95 100644 --- a/recipes/default.rb +++ b/recipes/default.rb @@ -11,7 +11,7 @@ end git "#{node[:s3cmd][:install_prefix_root]}/share/s3cmd" do - repository "git://github.com/s3tools/s3cmd.git" + repository "#{node[:s3cmd][:repository]}" reference node[:s3cmd][:version] action :sync end