diff --git a/CHANGELOG.md b/CHANGELOG.md index 99c338f..72a3afc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ ## head +## 0.2.0 (08/19/2014) + +added multiple repositories setup via attributes hash + ## 0.1.1 (08/11/2014) * remove unused reference to `intu_metadata` namespace diff --git a/README.md b/README.md index ebcbaeb..1ff26ea 100644 --- a/README.md +++ b/README.md @@ -21,6 +21,19 @@ Platform: `node['yum_s3_iam']['repo_bucket']` - Default value: 'http://our-bucket-name.s3.amazonaws.com' +## Multiple repositories setup +node['repo_default'] = false # Will not setup the default repository +node['repositories'] = { + "repo_name1": { + "repo_description": "...", + "repo_bucket": ".." + }, + "repo_name2": { + "repo_description": "...", + "repo_bucket": ".." + } +} + # Recipes ## default Installs `yum-s3-iam` package and configures a yum repo with S3/IAM support. diff --git a/attributes/default.rb b/attributes/default.rb index 9b00ca4..7a11a33 100644 --- a/attributes/default.rb +++ b/attributes/default.rb @@ -2,3 +2,5 @@ default['yum_s3_iam']['repo_name'] = 'our repo' default['yum_s3_iam']['repo_description'] = 'our package repo' default['yum_s3_iam']['repo_bucket'] = 'http://our-bucket-name.s3.amazonaws.com/' +default['yum_s3_iam']['repo_default'] = true +default['yum_s3_iam']['repositories'] = {} diff --git a/metadata.rb b/metadata.rb index c9b2020..bcedf79 100644 --- a/metadata.rb +++ b/metadata.rb @@ -4,7 +4,7 @@ license "Apache 2.0" description "Installs/Configures the yum-s3-iam plugin" long_description IO.read(File.join(File.dirname(__FILE__), 'README.md')) -version "0.1.1" +version "0.2.0" %w{ centos rhel }.each do |os| supports os diff --git a/recipes/default.rb b/recipes/default.rb index 62b9fb7..40a45ca 100644 --- a/recipes/default.rb +++ b/recipes/default.rb @@ -2,12 +2,26 @@ version node['yum_s3_iam']['version'] end -template File.join('/', 'etc', 'yum.repos.d', "#{node['yum_s3_iam']['repo_name']}.repo") do - owner 'root' - group 'root' - mode '0644' - source 's3-iam.repo.erb' - variables :repo_name => node['yum_s3_iam']['repo_name'], - :repo_description => node['yum_s3_iam']['repo_description'], - :repo_bucket => node['yum_s3_iam']['repo_bucket'] +if node['yum_s3_iam']['repo_default'] + template File.join('/', 'etc', 'yum.repos.d', "#{node['yum_s3_iam']['repo_name']}.repo") do + owner 'root' + group 'root' + mode '0644' + source 's3-iam.repo.erb' + variables :repo_name => node['yum_s3_iam']['repo_name'], + :repo_description => node['yum_s3_iam']['repo_description'], + :repo_bucket => node['yum_s3_iam']['repo_bucket'] + end +end + +node['yum_s3_iam']['repositories'].each do |repo_name,config| + template File.join('/', 'etc', 'yum.repos.d', "#{repo_name}.repo") do + owner 'root' + group 'root' + mode '0644' + source 's3-iam.repo.erb' + variables :repo_name => repo_name, + :repo_description => config['repo_description'], + :repo_bucket => config['repo_bucket'] + end end