Adoptable Cookbooks List

Looking for a cookbook to adopt? You can now see a list of cookbooks available for adoption!
List of Adoptable Cookbooks

Supermarket Belongs to the Community

Supermarket belongs to the community. While Chef has the responsibility to keep it running and be stewards of its functionality, what it does and how it works is driven by the community. The chef/supermarket repository will continue to be where development of the Supermarket application takes place. Come be part of shaping the direction of Supermarket by opening issues and pull requests or by joining us on the Chef Mailing List.

Select Badges

Select Supported Platforms

RSS

swap_tuning (6) Versions 0.1.0

Creates a swap file of the recommended size considering the system memory.

Berkshelf/Librarian
Policyfile
Knife
cookbook 'swap_tuning', '= 0.1.0'
cookbook 'swap_tuning', '= 0.1.0', :supermarket
knife cookbook site install swap_tuning
knife cookbook site download swap_tuning
README
Dependencies
Quality

Description

Cookbook Version Dependency Status Code Climate Build Status

Chef cookbook to create a swap file of the recommended size considering the system memory.

This can be considered a general purpose cookbook but certainly not recommended for all cases.

Swap size is chosen based on the following documentation:

In case you already have swap in the system, creates another swap file with the difference if necessary.

Requirements

Platform:

This cookbook has been tested on the following platforms:

  • Arch Linux
  • CentOS
  • Debian
  • Fedora
  • Ubuntu
  • Amazon

Let us know if you use it successfully on any other platform.

Cookbooks:

Applications:

  • Ruby 1.9.3 or higher.

Attributes

<table> <tr> <th>Attribute</th> <th>Description</th> <th>Default</th> </tr> <tr> <td><code>node['swap_tuning']['size']</code></td> <td>Total swap size in MB.</td> <td><em>calculated</em></td> </tr> <tr> <td><code>node['swap_tuning']['minimum_size']</code></td> <td>Swap minimum size in MB.</td> <td><code>nil</code></td> </tr> <tr> <td><code>node['swap_tuning']['file_prefix']</code></td> <td>Swap file name prefix.</td> <td><code>"/swapfile"</code></td> </tr> <tr> <td><code>node['swap_tuning']['persist']</code></td> <td>Swap file persist.</td> <td><code>true</code></td> </tr> </table>

Recipes

swap_tuning::default

Creates the swap file.

Usage

Including in a Cookbook Recipe

You can simply include it in a recipe:

# in your recipe
include_recipe "swap_tuning::default"

Don't forget to include the swap_tuning cookbook as a dependency in the metadata:

# metadata.rb
depends "swap_tuning"

Including in the Run List

Another alternative is to include it in your Run List:

{
  "name": "app001.onddo.com",
  [...]
  "run_list": [
    [...]
    "recipe[swap_tuning]"
  ]
}

Testing

Requirements

  • vagrant
  • foodcritic
  • rubocop
  • berkshelf
  • chefspec
  • test-kitchen
  • kitchen-vagrant

You must have VirtualBox and Vagrant installed.

You can install gem dependencies with bundler:

$ gem install bundler
$ bundle install

Running the Syntax Style Tests

$ bundle exec rake style

Running the Unit Tests

$ bundle exec rake unit

Running the Integration Tests

$ bundle exec rake integration

Or:

$ bundle exec kitchen list
$ bundle exec kitchen test
[...]

Running Integration Tests in the Cloud

Requirements:

  • kitchen-vagrant
  • kitchen-digitalocean
  • kitchen-ec2

You can run the tests in the cloud instead of using vagrant. First, you must set the following environment variables:

  • AWS_ACCESS_KEY_ID
  • AWS_SECRET_ACCESS_KEY
  • AWS_KEYPAIR_NAME: EC2 SSH public key name. This is the name used in Amazon EC2 Console's Key Pars section.
  • EC2_SSH_KEY_PATH: EC2 SSH private key local full path. Only when you are not using an SSH Agent.
  • DIGITALOCEAN_CLIENT_ID
  • DIGITALOCEAN_API_KEY
  • DIGITALOCEAN_SSH_KEY_IDS: DigitalOcean SSH numeric key IDs.
  • DIGITALOCEAN_SSH_KEY_PATH: DigitalOcean SSH private key local full path. Only when you are not using an SSH Agent.

Then, you must configure test-kitchen to use .kitchen.cloud.yml configuration file:

$ export KITCHEN_LOCAL_YAML=".kitchen.cloud.yml"
$ bundle exec kitchen list
[...]

Contributing

  1. Fork the repository on Github.
  2. Create a named feature branch ($ git checkout -b my-new-feature).
  3. Write your change.
  4. Write tests for your change (if applicable).
  5. Run the tests, ensuring they all pass ($ bundle exec rake).
  6. Commit your change ($ git commit -am 'Add some feature').
  7. Push to the branch ($ git push origin my-new-feature).
  8. Submit a Pull Request using Github.

TODO

  • Consider the available disk space.

License and Author

Author: Xabier de Zuazo (xabier@onddo.com)
Copyright: Copyright (c) 2014, Onddo Labs, SL. (www.onddo.com)
License: Apache License, Version 2.0
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.

Dependent cookbooks

swap >= 0.0.0

Contingent cookbooks

There are no cookbooks that are contingent upon this one.

No quality metric results found