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

Select Status

RSS

filesystem (35) Versions 1.0.0

Installs/Configures various filesystems

Policyfile
Berkshelf
Knife
cookbook 'filesystem', '= 1.0.0', :supermarket
cookbook 'filesystem', '= 1.0.0'
knife supermarket install filesystem
knife supermarket download filesystem
README
Dependencies
Changelog
Quality 100%

filesystem cookbook

Build Status Cookbook Version

This cookbook exists to generically define and create block device filesystems with the minimum of inputs.

This cookbook supports four main types of block devices:

  • normal device - drives, ssds, volumes presented by HBAs etc
  • device ID uuid - mostly found on drives / known block IDs.
  • LVM Volume Groups vg - found on systems using LVM.
  • file-backed file - created dynamically and looped back.

We will try to create filesystems in two ways: through keys found in node data under 'filesystems' or by being called directly with the filesystem default provider. See the example recipe.

You can also use your own key for a list of filesystems, see the example recipe for an example of this option.

Tools have been listed in the following attribute key : filesystem_tools. This allows for extending the support to other/new filesystems.

Requirements

  • lvm cookbook when creating logical volumes
  • package #{fstype}progs to support your chosen fstype. We provide some defaults, too.

Main Attributes

filesystems

Hash of filesytems to setup - this is called filesystems because filesystem is already created/managed by ohai (i.e. no s on the end).

node[:filesystems] keys:

Each filesytem's key is the FS label: This explains each key in a filesystems entry. The label must not exceed 12 characters.

We also let you use your own top-level key if you want - see the default recipe and example recipe.

Filesystem Backing Location keys

device

Path to the device to create the filesystem upon.

uuid

UUID of the device to create the filesystem upon.

file

Path to the file-backed storage to be used for a loopback device. device must also be present to specify the loopback. If the file is not present it will be created, as long as a size is given.

vg

Name of the LVM volume group use as backing store for a logical volume. If not present it will be created, as long as a size is given.

Each filesystem should be given one of these attributes for it to have a location to be created at.

If none of these are present then we try to find a device at the label itself.

Filesystem Creation Options

fstype [ocfs2|ext3|ext4|etc] (default: ext3)

The type of filesystem to be created.

mkfs_options unique for each filesystem.

Options to pass to mkfs at creation time.

Filesystem Backing Options

size 10000 (file) or 10%VG|10g (vg)

The size, only used for filesystems backed by vg and file storage. If vg then a number suffixied by the scale [g|m|t|p], if a file then just a number [megabytes].

sparse Boolean (default: true)

Sparse file creation, used by the file storage, by default we use this for speed, but you may not want that.

stripes optional.

The stripes, only used for filesystems backed by vg aka LVM storage.

mirrors optional.

The mirrors, only used for filesystems backed by vg aka LVM storage.

Filesystem Mounting Options

mount /path/to/mount

Path to mount the filesystem. (If present we will mount the filesystem - this is rather important)

options rw,noatime,defaults (default: defaults)

Options to mount with and add to the fstab.

dump 0|1|2 (default: 0)

Dump entry for fstab

pass 0|1|2 (default: 0)

Pass entry for fstab

user name

Owner of the mountpoint, otherwise we use the chef default. We will not try to create users. You should use the users cookbook for that.

group name

Group of the mountpoint, otherwise we use the chef default. We will not try to create groups. You should write a cookbook to make them nicely.

mode 775

Mode of the mountpoint, otherwise we use the chef default.

Package and Recipe Options

package Package name to install, if specified.

Used to support the filesystem

recipe Recipe to run, if specified - for future use, not currently supported from the lwrp.

Used to support the filesystem

Atypical Behaviour Modifiers

force Boolean (default: false)

Set to true we unsafely create filesystems. If there is data it will be lost. Should not use this unless you are quite confident.

ignore_existing Boolean (default: false)

Set to true we will ignore existing filesystems and recreate them. Double Dangerous and only for unsound behaviour. Use with 'force' true.

nomkfs Boolean (default: false)

Set to true to disable creation of the filesystem.

nomount Boolean (default: false)

Set to true to disable mounting of the filesystem.

noenable Boolean (default: false)

Set to true to disable adding to fstab.

Usage

Keyed filesystem creation:

{
 "filesystems": {
   "testfs1": {
     "device": "/dev/sdb",
     "mount": "/db",
     "fstype": "xfs",
     "optons": "noatime,nobarrier",
     "mkfs_options": "-d sunit=128,swidth=2048"
   },
   "applv1": {
     "mount": "/logical1",
     "fstype": "ext4",
     "vg": "standardvg",
     "size": "20G"
   },
   "cluster_01": {
     "fstype": "ocfs2",
     "package": "ocfs2-tools",
     "device": "/dev/mpath/ocfs01",
     "mount": "/mnt/test"
    },
   "filebacked": {
     "file": "/mnt/filesystem-on-a-filesystem.file",
     "device": "/dev/loop7",
     "mount": "/mnt/filesystem-on-a-filesystem",
     "size": "20000"
    }
  }
}

Direct LWRP'd creation:

filesystem "label" do
  fstype "ext3"
  device "/dev/sdb1"
  mount "/mnt/littlelabel"
  action [:create, :enable, :mount]
end

Links

Development is at https://github.com/atrullmdsol/filesystem_cookbook
Opscode community page is at http://community.opscode.com/cookbooks/filesystem

Authors

Changelog

Change Log All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog and this project adheres to Semantic Versioning.

unreleased

1.0.0 - 2018-03-14

  • Fix idempotence of 'wait for device' block
  • Remove possible double format of disks if force
  • Do not perform test mount if ignore_existing and force
  • Use truthy value of ignore_existing rather than nil?
  • updated mount resource in providers/default.rb to notify directory resource immediately to fix mount permissions after mounting
  • Fix linting errors
  • Updated default provider to notify directory resource immediately upon mounting filesystem. (#37)
  • Reorganise code to only format disks once
  • Fix missing /etc/fstab file in centos7 image
  • Remove xfsprogs-devel

0.12.0 - 2017-04-24

  • removed xfs dependency, installing packages in default.rb

0.11.1 - 2017-03-20

  • fixed issue with frozen being a ruby default function

0.11.0 - 2017-03-13

  • Added CHANGELOG.md
  • Added CONTRIBUTING.md
  • Removed Berksfile.lock
  • Added CODE_OF_CONDUCT.md
  • Added Delivery
  • Added Travis
  • Added Test-Kitchen, Kitchen-dokken
  • updated Berksfile to supermarket
  • updated lvm >= 1.1
  • updated to sous-chefs

0.10.6 - 2016-01-21

0.10.2 - 2015-10-13

  • dont wait for network devices they won't exist
  • make fetches to fspackages not fail on unknown types

Added

Collaborator Number Metric
            

1.0.0 passed this metric

Contributing File Metric
            

1.0.0 passed this metric

Foodcritic Metric
            

1.0.0 passed this metric

No Binaries Metric
            

1.0.0 passed this metric

Testing File Metric
            

1.0.0 passed this metric

Version Tag Metric
            

1.0.0 passed this metric