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


ramdisk (3) Versions 0.2.1

Manage tmpfs RAM disks with Chef

cookbook 'ramdisk', '~> 0.2.1'
cookbook 'ramdisk', '~> 0.2.1', :supermarket
knife supermarket install ramdisk
knife supermarket download ramdisk
Quality 75%

Ramdisk Cookbook

Cookbook Version Dependency Status Code Climate Build Status Coverage Status

This cookbook manages tmpfs RAM disks with Chef.


Supported Platforms

This cookbook has been tested on the following platforms:

  • CentOS
  • Debian
  • Fedora
  • FreeBSD
  • RedHat
  • Ubuntu

FreeBSD support is somewhat limited due to its current implementation: the remount is not supported on this platform and some mount options are ignored.

Please, let us know if you use it successfully on any other platform.

Required Applications

  • Ruby 1.9.3 or higher.



Creates or deletes a RAM disk.

If you change the RAM disk size, the ramdisk resource will try to remount the disk without umounting.

ramdisk Actions

  • create: Creates a RAM disk (default).
  • delete: Deletes a RAM disk.

ramdisk Parameters

Parameter Default Description
path name parameter tmpfs RAM disk mount path.
size nil Size of the filesystem (required). The size is given in bytes. Also accepts a suffix k, m or g.
persist true Whether to persist the RAM disk. Note: The data will not persist between reboots. This only creates the RAM disk on each boot.
nosuid false Do not allow set-user-identifier or set-group-identifier bits to take effect.
nodev false Do not interpret character or block special devices on the filesystem.
noexec false Do not allow direct execution of any binaries on the mounted filesystem.
noatime false Do not update inode access times on this filesystem.
nodiratime false Do not update directory inode access times on this filesystem.
inodes nil The maximum number of inodes for this instance.
mode nil Set initial permissions of the root directory.
uid nil The user id.
gid nil The group id.
user nil The same as uid, but using user names.
group nil The same as gid, but using group names.
mpol nil Set the NUMA memory allocation policy for all files in that instance.


These attributes are primarily intended to support the different platforms. Do not touch them unless you know what you are doing.

Attribute Default Description
node['ramdisk']['options']['default'] ['rw'] Minimal default mount options to set.
node['ramdisk']['options']['flags'] calculated Supported mount flag options: nosuid, noexec, ...
node['ramdisk']['options']['variables'] calculated Supported mount variable options: size=, mode=, uid=, ...
node['ramdisk']['supports']['remount'] calculated Whether mount remount operation is supported.


Including in the metadata

Before using this cookbook, remember to put it as a dependency in your metadata:

# metadata.rb
depends 'ramdisk'

Basic Example

Create a 10MB tmpfs RAM disk:

ramdisk '/mnt/ramdisk1' do
  size '10m'

A Complex Example

Create a tmpfs RAM disk setting some options and the owner user:

ramdisk '/tmp/secure_bob_ramdisk' do
  size '1g'
  user 'bob'
  group 'bob'
  persist false
  nosuid true
  nodev true
  noexec true
  noatime true
  inodes '999k'
  mode '750'



ChefSpec Matchers


Helper method for locating a ramdisk resource in the collection.

resource = chef_run.ramdisk('/mnt/ramdisk1')
expect(resource).to notify('service[java-app]').to(:restart)


Assert that the Chef run creates a ramdisk.

expect(chef_run).to create_ramdisk('/mnt/ramdisk1')


Assert that the Chef run deletes a ramdisk.

expect(chef_run).to delete_ramdisk('/mnt/ramdisk1')


Please do not hesitate to open an issue with any questions or problems.




License and Author

Author: Xabier de Zuazo (
Contributor: Hendrik Bergunde
Copyright: Copyright (c) 2015, Xabier de Zuazo
Copyright: Copyright (c) 2014, Onddo Labs, SL.
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

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
See the License for the specific language governing permissions and
limitations under the License.

Dependent cookbooks

This cookbook has no specified dependencies.

Contingent cookbooks

There are no cookbooks that are contingent upon this one.


This file is used to list changes made in each version of the ramdisk cookbook.

v0.2.1 (2015-08-26)

  • README: Fix coverage badge.

v0.2.0 (2015-08-26)

  • LwrpHelpers: improve similar code using delegation.
  • Gemfile: Update RuboCop to 0.33.0 (issue #1, thanks Hendrik Bergunde).
  • metadata: Add source_url and issues_url.

  • Documentation:

    • Update chef links to use domain.
    • Update contact information and links after migration.
    • README: Put the cookbook name in the title.
    • Document the Rakefile.
    • Move the ChefSpec matchers documentation to the README.
  • Testing:

    • Travis: Run tests against Chef 11 and Chef 12.
    • Rakfile: Add clean task.
    • Fix ChefSpec tests.
    • Fix integration tests for Ubuntu 15.04 and OpenSUSE.
    • Move ChefSpec tests to test/unit.

v0.1.0 (2014-11-24)

  • Initial release of ramdisk.

Collaborator Number Metric

0.2.1 failed this metric

Failure: Cookbook has 1 collaborators. A cookbook must have at least 2 collaborators to pass this metric.

Contributing File Metric

0.2.1 passed this metric

Foodcritic Metric

0.2.1 failed this metric

FC066: Ensure chef_version is set in metadata: ramdisk/metadata.rb:1
FC069: Ensure standardized license defined in metadata: ramdisk/metadata.rb:1
FC072: Metadata should not contain "attribute" keyword: ramdisk/metadata.rb:1
FC085: Resource using new_resource.updated_by_last_action to converge resource: ramdisk/libraries/lwrp_helpers.rb:90
FC085: Resource using new_resource.updated_by_last_action to converge resource: ramdisk/providers/default.rb:25
FC085: Resource using new_resource.updated_by_last_action to converge resource: ramdisk/providers/default.rb:36
Run with Foodcritic Version 14.3.0 with tags metadata,correctness ~FC031 ~FC045 and failure tags any

No Binaries Metric

0.2.1 passed this metric

Publish Metric

0.2.1 passed this metric

Supported Platforms Metric

0.2.1 passed this metric

Testing File Metric

0.2.1 passed this metric

Version Tag Metric

0.2.1 passed this metric