Skip to content

chef-cookbooks/chef_zfs

This branch is 28 commits ahead of marthag8/zfs:master.

Repository files navigation

chef_zfs Cookbook

Build Status Cookbook Version

A resource for managing ZFS filesystems. This cookbook is forked from the original zfs cookbook by Martha Greenberg at https://github.com/marthag8/zfs.

Requirements

Platforms

  • Ubuntu
  • FreeBSD
  • Solaris

Chef

  • Chef 12.7+

Cookbooks

  • none

Resources

zfs

Actions

  • :create
  • :upgrade
  • :destroy

Properties

  • properties: ZFS properties are set as an Array of Hashes to configure the filesystems using the single properties attribute.

Examples

Creating a ZFS Filesystem
zfs "tank/test" do
  properties [
    { mountpoint: '/opt/test' },
    { relatime: 'on' },
    { compression: 'lz4' }
  ]
  action :create
end
Upgrading a ZFS to the latest filesystem version:
zfs "tank/test" do
  action :upgrade
end
zfs "tank/test" do
  properties [
    { mountpoint: '/opt/test' },
    { relatime: 'on' },
    { compression: 'lz4' }
  ]
  action [:create, :upgrade]
end
Destroying a ZFS Filesystem
zfs "tank/test" do
  action :destroy
end

✨ Note that destroy flags are not directly supported. However, some like the -d flag can be used by setting the defer_destroy property on the filesystem prior to destruction. See the example below.

filesystem = zfs "tank/test" do
  properties [
    { defer_destroy: 'on' }
  ]
  action :create
  only_if "zfs list | grep -q #{self.name}"
end

zfs filesystem.name do
  action :destroy
end

Maintainers

This cookbook is maintained by Chef's Community Cookbook Engineering team. Our goal is to improve cookbook quality and to aid the community in contributing to cookbooks. To learn more about our team, process, and design goals see our team documentation. To learn more about contributing to cookbooks like this see our contributing documentation, or if you have general questions about this cookbook come chat with us in #cookbok-engineering on the Chef Community Slack

License

Copyright: 2012-2017, Martha Greenberg Copyright: 2017, Chef Software, Inc.

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.

About

No description or website provided.

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Ruby 100.0%