Use the zfs_dataset Chef InSpec audit resource to test the ZFS datasets on FreeBSD & Linux (Check OS Family Details for more details).
This resource is distributed along with Chef InSpec itself. You can use it automatically.
This resource first became available in v1.16.0 of InSpec.
A zfs_dataset resource block declares the ZFS dataset properties that should be tested:
describe zfs_dataset('dataset') do
it { should MATCHER 'value' }
end
where
('dataset') is the name of the ZFS dataset (eg: 'tank/tmp')MATCHER is a valid matcher for this resource'value' is the value to be testedThe following examples show how to use this Chef InSpec audit resource.
describe zfs_dataset('tank/tmp') do
it { should be_mounted }
its('atime') { should eq 'on' }
its('compression') { should eq 'lz4' }
its('exec') { should eq 'off' }
its('readonly') { should eq 'off' }
its('setuid') { should eq 'off' }
end
This Chef InSpec audit resource has the matchers listed below, in addition to dynamically exposing all ZFS dataset properties available (see: man zfs for the list of supported properties). For a full list of available matchers, please visit our matchers page.
The be_mounted matcher tests if the dataset is accessible from the file system:
it { should be_mounted }
© Chef Software, Inc.
Licensed under the Creative Commons Attribution 3.0 Unported License.
The Chef™ Mark and Chef Logo are either registered trademarks/service marks or trademarks/servicemarks of Chef, in the United States and other countries and are used with Chef Inc's permission.
We are not affiliated with, endorsed or sponsored by Chef Inc.
https://docs.chef.io/inspec/resources/zfs_dataset/