Chef s3cmd

Chef Cookbook to Install and Manage s3cmd for amazon s3

View the Project on GitHub vkhatri/chef-s3cmd-ng

s3cmd-ng Cookbook

Build Status

This is a Chef cookbook to manage s3cmd using LWRP.

This cookbook allows to manage different s3cmd config files, sync a directory or sync a s3 file and it can be extracted to a directory.

Repository

https://github.com/vkhatri/chef-s3cmd-ng

Cookbook Dependencies

Recipes

Attributes

LWRP Resources

LWRP s3cmd_cfg

LWRP s3cmd_cfg is used to create/delete s3cmd config file.

Create a s3cmd config file

s3cmd_cfg "foo" do
  access_key "aws s3 access key"
  secret_key "aws s3 secret key"
  file "file location"
  user "user name"
  group "group name"
  region "aws region name, e.g. Singapore"
  option "value" ..
end

Create a s3cmd config file from a databag

s3cmd_cfg "foo" do
  file "file location"
  user "user name"
  group "group name"
  databag "databag name for aws access/secret key"
  databag_item "databag item name to load access_key & secret_key"
  databag_secret "encrypted databag secret if any"
  bucket_location "aws region name, e.g. Singapore"
  option "value" ..
end

Delete a s3cmd config file

s3cmd_cfg "foo" do
  action :delete
end

LWRP Options

Parameters:

LWRP s3cmd_dir

LWRP s3cmd_dir is a wrapper for s3cmd sync.

Create a s3cmd sync dir resource

s3cmd_dir "foo" do
  s3cfg_file "s3cmd config file"
  s3_url "s3 bucket url"
  user "user name"
  group "group name"
  s3cmd_options "--option value --option value .. if any"
  sync_dir "local dir to sync s3 url to"
  verify_file "verify file, raie exception is missing"
  mode "dirs / files mode"
  umask "user umask"
  manage_sync_dir "whether to manage local sync dir"
end

Delete a s3cmd sync dir

s3cmd_dir "foo" do
  action :delete
end

LWRP Options

Parameters:

LWRP s3cmd_file

LWRP s3cmd_dir is a wrapper for s3cmd sync.

Create a s3cmd sync dir resource

s3cmd_file "foo" do
  s3cfg_file "s3cmd config file"
  s3_url "s3 bucket file url"
  user "user name"
  group "group name"
  s3cmd_options "--option value --option value .. if any"
  download_dir "local dir to download s3 file"
  manage_download_dir true # whether to manage download_dir
  extract_dir "untar a tar file to this location"
  extract true # whether to extract a tar file
  mode "dirs / files mode"
  umask "user umask"
end

Delete a s3cmd file

s3cmd_file "foo" do
  s3_url "s3 bucket file url"
  download_dir "download location"
  extract_dir "directory location" # delete extract directory if specified
  action :delete
end

LWRP Options

Parameters:

Contributing

  1. Fork the repository on Github
  2. Create a named feature branch (like add_component_x)
  3. Write your change
  4. Write tests for your change (if applicable)
  5. Run the tests (rake), ensuring they all pass
  6. Write new resource/attribute description to README.md
  7. Write description about changes to PR
  8. Submit a Pull Request using Github

Copyright & License

Authors:: Virender Khatri and Contributors

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.