cookbook 'swap', '~> 2.2.2'
The swap cookbook has been deprecated
Author provided reason for deprecation:
The swap cookbook has been deprecated and is no longer being maintained by its authors. Use of the swap cookbook is no longer recommended.
swap
(20) Versions
2.2.2
-
Follow20
Manage swap and swapfiles with Chef
cookbook 'swap', '~> 2.2.2', :supermarket
knife supermarket install swap
knife supermarket download swap
The swap resource from this cookbook is now shipping as part of Chef 14. With the inclusion of this resource into Chef itself we are now deprecating this cookbook. It will continue to function for Chef 13 users, but will not be updated.
Swap Cookbook
This cookbook provides resource for easily creating and managing swap files.
Requirements
Platforms
- Debian / Ubuntu derivatives
- RHEL and derivatives
- Fedora
- openSUSE / SUSE Linux Enterprises
Chef
- Chef 12.7+
Cookbooks
- none
Usage
Add a new swap:
swap_file '/mnt/swap' do size 1024 # MBs end
Or remove an existing one:
swap_file '/mnt/swap' do action :remove end
LWRP Attributes
Attribute | Description | Example | Default |
---|---|---|---|
path | The path to put the swap file on the system | /mnt/swap | |
size | The size (in MBs) for the swap file | 2048 | |
persist | Persist the swapon | true | false |
timeout | Timeout for dd/fallocate | 600 | 600 |
Installation
If you're using berkshelf, add swap
to your Berksfile
:
cookbook 'swap'
Otherwise, install the cookbook from the community site:
knife cookbook site install swap
Have any other cookbooks depend on this cookbook by adding it to the metadata.rb
:
depends 'swap'
Now you can use the LWRP in your cookbook!
ChefSpec matchers
create_swap_file(path)
Assert that the Chef run creates swap_file.
expect(chef_run).to create_swap_file(path).with( :size => 1024 )
remove_swap_file(path)
Assert that the Chef run removes swap_file.
expect(chef_run).to remove_swap_file(path)
Contributing
- Fork the project
- Create a feature branch corresponding to you change
- Commit and test thoroughly
- Create a Pull Request on github
- ensure you add a detailed description of your changes
License & Authors
- Author:: Seth Vargo (sethvargo@gmail.com)
Copyright 2012-2016, Seth Vargo 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.
swap Cookbook CHANGELOG
This file is used to list changes made in each version of the swap cookbook.
v2.2.2 (2018-04-07)
- The swap resource from this cookbook is now shipping as part of Chef 14. With the inclusion of this resource into Chef itself we are now deprecating this cookbook. It will continue to function for Chef 13 users, but will not be updated.
v2.2.1 (2018-03-15)
- Fix #60, incorrect permissions on
set_permissions
v2.2.0 (2018-03-14)
- General tidy up of resources
- Migrate helpers into the helpers file
- Cleanup test suites
v2.1.0 (2017-08-17)
- Added sysctl and swappiness to create call. This adds a dependency on systctl
- Require Chef 12.7 or later since 12.5/12.6 had issues with custom resources
- Add integration testing in Travis with kitchen-dokken
- Add testing with Delivery local mode
- Update the dokken config to use the dokken images
- Fix the license metadata to be a SPDX compliant license string
- Convert the integration tests from bats to InSpec
- Add a very basic ChefSpec test
v2.0.0 (2017-02-23)
- Now supports a timeout property for create
- Converted to a custom resource to resolve the failures in the 1.0 release and wired up proper converge messaging. This requires Chef 12.5 or later
v1.0.0 (2017-02-22)
- This cookbook has been transferred to the Sous Chefs. See sous-chefs.org
- Require Chef 12.1 or later
v0.4.0
- Use provides if available to avoid deprecation warnings on Chef 12.4+
- Add -P to df to account for long device names
- Check that swap exist before removing it
- Add a chefignore file to limit the files uploaded to the Chef server
- Add new issues_url, source_url and chef_version metadata
- Update testing with a Rakefile, Cookstyle, and ChefDK testing in Travis
- Update the requirements section in the Readme
- Add supported platforms to the metadata
v0.3.8
- Missing missing method name get_fallocate_command
v0.3.7
- Updated to latest test harness
v0.3.6
- Remove
size
as a required attribute, since it doesn't make sense to require it during the "remove" action
v0.3.1
- CHANGELOG is deprecated - see releases
v0.3.0
- Integrate test-kitchen
- Integrate foodcritic
- Integrate chefspec
- Integrate strainer
- Integrate knife testing
- Add travis support
- Add
persist
key to write tofstab
v0.2.0
- Use fallocate if available - @andrewgross
- Small code restructure
v0.1.1
- Fix error in documentation (it's MB, not GB) (@dougal)
v0.1.0
- Initial release
Collaborator Number Metric
2.2.2 failed this metric
Failure: Cookbook has 1 collaborators. A cookbook must have at least 2 collaborators to pass this metric.
Contributing File Metric
2.2.2 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a CONTRIBUTING.md file
Foodcritic Metric
2.2.2 passed this metric
No Binaries Metric
2.2.2 passed this metric
Testing File Metric
2.2.2 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a TESTING.md file
Version Tag Metric
2.2.2 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must include a tag that matches this cookbook version number
2.2.2 failed this metric
2.2.2 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a CONTRIBUTING.md file
Foodcritic Metric
2.2.2 passed this metric
No Binaries Metric
2.2.2 passed this metric
Testing File Metric
2.2.2 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a TESTING.md file
Version Tag Metric
2.2.2 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must include a tag that matches this cookbook version number
2.2.2 passed this metric
2.2.2 passed this metric
Testing File Metric
2.2.2 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a TESTING.md file
Version Tag Metric
2.2.2 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must include a tag that matches this cookbook version number
2.2.2 failed this metric
2.2.2 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must include a tag that matches this cookbook version number