Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Back to homepage

Zram

The zram cookbook is intended to convert a set percentage of the system’s memory into compressed swap space. https://en.wikipedia.org/wiki/Zram

The cookbook is formatted to act as a base from which other cookbooks wrap around. It sets default attributes that may be tweaked by the wrapper cookbook.

  • chef_version ‘>= 13.0’
  • supports ‘redhat’, ‘>= 7.0’
  • supports ‘ubuntu’, ‘>= 18.04’

The org attribute is used as a way to delineate your specific attribute sets from default ones. Setting it as an attribute accommodates environments with multiple organizations to prevent crosstalk. Usually the org value is set within the environment(s) for that organization.

Installation

Include with an application/alternate cookbook.

  1. Add to metadata.rb: depends 'zram'
  2. Add to a recipe where desired: include_recipe 'zram::default'
  3. Adjust attributes in application/alternate cookbook as desired.

Or you may add this to the run_list of a node/role/environment.

Uninstall

  1. Remove all references of zram from a cookbook/node/role/environment.
  2. Run the uninstall recipe on the servers: chef-client -o 'recipe[zram::uninstall]