Git Product home page Git Product logo

puppetlabs-zfs_core's Introduction

zfs_core

Modules Status Modules Status Modules Status Modules Status

Table of Contents

  1. Description
  2. Usage - Configuration options and additional functionality
  3. Reference - An under-the-hood peek at what the module is doing and how
  4. Limitations - OS compatibility, etc.
  5. Development - Guide for contributing to the module

Description

The zfs_core module is used to manage both zfs and zpool resources. Though This module is only tested on Solaris machines, it should also work on any machine that has zfs or zpool resources.

Usage

To create a zpool resource with the name tstpool that uses the disk /ztstpool/dsk, use the following code:

zpool { 'tstpool':
  ensure => present,
  disk => '/ztstpool/dsk',
}

To create a zfs resource based on the pool created above, use the following code:

zfs { 'tstpool/tstfs':
  ensure => present,
}

Reference

Please see the REFERENCE.md documentation for the zfs_core and zpool_core modules.

This module is documented using Puppet Strings.

For a quick primer on how Strings works, please see this blog post or the README.md for Puppet Strings.

To generate documentation locally, run the following command:

bundle install
bundle exec puppet strings generate ./lib/**/*.rb

This command will create a browsable \_index.html file in the doc directory. The references available here are all generated from YARD-style comments embedded in the code base. When any development happens on this module, the impacted documentation should also be updated.

Limitations

This module is only available on platforms that have both zfs and zpool available.

Development

Puppet Labs modules on the Puppet Forge are open projects, and community contributions are essential for keeping them great. We can't access the huge number of platforms and myriad of hardware, software, and deployment configurations that Puppet is intended to serve.

We want to keep it as easy as possible to contribute changes so that our modules work in your environment. There are a few guidelines that we need contributors to follow so that we can have a chance of keeping on top of things.

For more information, see our module contribution guide.

puppetlabs-zfs_core's People

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

puppetlabs-zfs_core's Issues

Add support for enrypted volumes/date sets

Use Case

ZFS supports per-volume encryption, but it lacks the option that sets "encryption on" and any option to specify the keysource.

Describe the Solution You Would Like

Add two options, encryption and key source

Describe Alternatives You've Considered

Create the volume outside of puppet

fact for datasets/volumes

Use Case

If you want to create encrypted datasets/volumes automatically, the key material may only be generated during the initial setup.
This requires a fact that makes it possible to test for the presence of datasets/volumes in a pool so that the key material is not generated again.

Describe the Solution You Would Like

An simple puppet like this:
$facts['zfs']['']['<volume/dataset name>']
Optional the fact can provide additional information about the pool and the volumes/datasets
So that this code will work:

if $facts['zfs']['foo']['bar'] {
exec { 'create_key_material':
....
}
zfs { 'bar':
...
require => Exec[...]
}
}

Describe Alternatives You've Considered

Do this manual on the server, because the key material will only present temporary on an ram disk on the server.
So the "creates" of exec will not an option.

Handling of integer values causes puppet to always apply properties

Describe the Bug

Hi,
Because of the way ZFS properties can be passed and are returned by the zfs get commands, Puppet applies properties even though they already have the correct values, e.g.

quota changed '4.88T' to '5000G' (corrective)`
reservation changed '6T' to '6597069766656' (corrective)

Expected Behavior

When the values match, the module should detect it and not attempt to set them again.

Steps to Reproduce

  1. Set a quota of 5000G
  2. Set a reservation of 6597069766656

Environment

  • Version 8.4.0
  • Platform Debian 12

Additional Context

I thought of the following patch:

diff --git a/lib/puppet/provider/zfs/zfs.rb b/lib/puppet/provider/zfs/zfs.rb
index 976d9bf..b97ec0c 100644
--- a/lib/puppet/provider/zfs/zfs.rb
+++ b/lib/puppet/provider/zfs/zfs.rb
@@ -82,7 +82,7 @@ Puppet::Type.type(:zfs).provide(:zfs) do
    :secondarycache, :setuid, :sharenfs, :sharesmb,
    :snapdir, :sync, :version, :volsize, :vscan, :xattr].each do |field|
     define_method(field) do
-      zfs(:get, '-H', '-o', 'value', field, @resource[:name]).strip
+      zfs(:get, '-p', '-H', '-o', 'value', field, @resource[:name]).strip
     end
 
     define_method(field.to_s + '=') do |should|

It would prevent issues when the Puppet configuration uses exact values:
But it doesn't help when we pass Puppet human-readable values, e.g.

quota changed '5368709120000' to '5000G' (corrective)

Maybe the solution would be to:

  • apply the above patch
  • convert human-readable values to exact values before applying them

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.