cookbook 'zfs_linux', '~> 2.1.3'
zfs_linux (7) Versions 2.1.3 Follow4
Installs/Configures zfs on linux
cookbook 'zfs_linux', '~> 2.1.3', :supermarket
knife supermarket install zfs_linux
knife supermarket download zfs_linux
zfs_linux Cookbook
Installs & configures zfs on Ubuntu.
Requirements
Ubuntu 12.04+
Usage
zfs_linux::default
Just include zfs_linux
in your node's run_list
:
{ "name":"my_node", "run_list": [ "recipe[zfs_linux]" ] }
zfs_linux::auto-snapshot
Installs the zfs-auto-snapshot package, which automatically sets up rotating snapshots (hourly snapshots kept for a day, daily snapshots kept for a month, etc).
zfs_linux::auto-scrub
Uses cron.d (via the cron cookbook) to setup cron jobs on Sunday morning for each zpool. If greater than 4 zpools are present, runs the checks once a month on the first Sunday.
zfs_linux::source
This recipe was developed to allow the deployment of ZoL from a specific commit. Apply it to your node to pull down the ZFS revision from git (specified in your node's attributes).
WARNING: On Debian-family systems, the current build method will disable automatic updates for your kernel because the ZoL packages will be built for the kernel that is running at the time of compilation. Do not apply this without a process in place for monitoring security updates and applying them manually in the following manner:
1. Update your system kernel packages
2. Disable the auto-start of any services that depend on your ZoL-mounted volumes
3. Reboot into the new kernel
4. Delete the zfs & spl directories in /var/chef/cache/
5. Perform a chef-client run
6. Enable auto-start again for your node's services
7. Reboot
Resources/Providers
zfs_linux_snapshot
Actions
-
:create
: Creates a snapshot of the dataset -
:prune
: Deletes a datasets snapshots down to a specified number of snapshots -
:purge
: Deletes all snapshots for a dataset
Attribute Parameters
-
dataset
: Name of the zpool/fileset. Defaults to the resource name. -
prefix
: String to prefix the snapshot name. Defaults tozfs-chef-snap
. When pruning/purging snapshots, used to filter the list of snapshots to be deleted (set tonil
to disable the search filter). -
snaps_to_retain
: The number of snapshots to retain (only applies to the:prune
action). Defaults to31
-
append_timestamp
: Boolean to determine whether a timestamp (in the form of-YY-MM-DD-HHmm
) is appended to the snapshot prefix. Defaults totrue
Examples
# Create a snapshot with a specific name zfs_linux_snapshot 'tank/mydataset' do prefix 'myweeklysnapshot' append_timestamp false end # Delete all snapshots that match 'weekly' zfs_linux_snapshot 'tank/mydataset' do prefix 'weekly' action :purge end # Remove all but the last 6 monthly snapshots zfs_linux_snapshot 'tank/mydataset' do prefix 'zfs-auto-snap_monthly' snaps_to_retain 6 action :prune end
Contributing
- Fork the repository on Github
- Create a named feature branch (like
add_component_x
) - Write your change
- Write tests for your change (if applicable)
- Run the tests, ensuring they all pass
- Submit a Pull Request using Github
License and Authors
Copyright 2015, Biola University
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.
Dependent cookbooks
apt >= 0.0.0 |
cron >= 0.0.0 |
yum-epel >= 0.0.0 |
Contingent cookbooks
There are no cookbooks that are contingent upon this one.
zfs_linux Cookbook CHANGELOG
This file is used to list changes made in each version of the zfs_linux cookbook.
v2.1.1 (2015-03-18)
- Fix auto-scrub cron distribution for systems w/ 6-12 zpools
v2.1.0 (2015-03-02)
- Add udev rule for managing ZFS device permissions.
- New
['zol']['dev_group']
and['zol']['dev_perms']
attributes should optionally allow basic ZoL management by non-root users.
- New
v2.0.0 (2014-11-14)
- Remove attribute driven snapshot-pruning recipe; replaced with zfs_linux_snapshot resource.
- Previous deployments of the snapshot-pruning recipe will need to manually remove stale /etc/cron.daily/zfs-auto-prune... files.
- Dropped RHEL support for now
Collaborator Number Metric
2.1.3 passed this metric
Contributing File Metric
2.1.3 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a CONTRIBUTING.md file
Foodcritic Metric
2.1.3 failed this metric
FC085: Resource using new_resource.updated_by_last_action to converge resource: zfs_linux/providers/snapshot.rb:44
FC085: Resource using new_resource.updated_by_last_action to converge resource: zfs_linux/providers/snapshot.rb:57
FC085: Resource using new_resource.updated_by_last_action to converge resource: zfs_linux/providers/snapshot.rb:70
FC109: Use platform-specific package resources instead of provider property: zfs_linux/recipes/default.rb:59
FC109: Use platform-specific package resources instead of provider property: zfs_linux/recipes/source.rb:127
Run with Foodcritic Version 16.3.0 with tags metadata,correctness ~FC031 ~FC045 and failure tags any
No Binaries Metric
2.1.3 passed this metric
Testing File Metric
2.1.3 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a TESTING.md file
Version Tag Metric
2.1.3 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must include a tag that matches this cookbook version number
2.1.3 passed this metric
2.1.3 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a CONTRIBUTING.md file
Foodcritic Metric
2.1.3 failed this metric
FC085: Resource using new_resource.updated_by_last_action to converge resource: zfs_linux/providers/snapshot.rb:44
FC085: Resource using new_resource.updated_by_last_action to converge resource: zfs_linux/providers/snapshot.rb:57
FC085: Resource using new_resource.updated_by_last_action to converge resource: zfs_linux/providers/snapshot.rb:70
FC109: Use platform-specific package resources instead of provider property: zfs_linux/recipes/default.rb:59
FC109: Use platform-specific package resources instead of provider property: zfs_linux/recipes/source.rb:127
Run with Foodcritic Version 16.3.0 with tags metadata,correctness ~FC031 ~FC045 and failure tags any
No Binaries Metric
2.1.3 passed this metric
Testing File Metric
2.1.3 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a TESTING.md file
Version Tag Metric
2.1.3 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must include a tag that matches this cookbook version number
2.1.3 failed this metric
FC085: Resource using new_resource.updated_by_last_action to converge resource: zfs_linux/providers/snapshot.rb:57
FC085: Resource using new_resource.updated_by_last_action to converge resource: zfs_linux/providers/snapshot.rb:70
FC109: Use platform-specific package resources instead of provider property: zfs_linux/recipes/default.rb:59
FC109: Use platform-specific package resources instead of provider property: zfs_linux/recipes/source.rb:127
Run with Foodcritic Version 16.3.0 with tags metadata,correctness ~FC031 ~FC045 and failure tags any
2.1.3 passed this metric
Testing File Metric
2.1.3 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a TESTING.md file
Version Tag Metric
2.1.3 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must include a tag that matches this cookbook version number
2.1.3 failed this metric
2.1.3 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must include a tag that matches this cookbook version number