A resource for managing ZFS filesystems. This cookbook is forked from the original zfs cookbook by Martha Greenberg at https://github.com/marthag8/zfs.
- Ubuntu
- FreeBSD
- Solaris
- Chef 12.7+
- none
:create
:upgrade
:destroy
properties
: ZFS properties are set as an Array of Hashes to configure the filesystems using the singleproperties
attribute.
zfs "tank/test" do
properties [
{ mountpoint: '/opt/test' },
{ relatime: 'on' },
{ compression: 'lz4' }
]
action :create
end
zfs "tank/test" do
action :upgrade
end
zfs "tank/test" do
properties [
{ mountpoint: '/opt/test' },
{ relatime: 'on' },
{ compression: 'lz4' }
]
action [:create, :upgrade]
end
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
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
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.