Showing with 31 additions and 23 deletions.
  1. +9 −1 CHANGELOG.md
  2. +7 −12 lib/puppet/provider/zfs/zfs.rb
  3. +5 −3 lib/puppet/type/zfs.rb
  4. +9 −6 locales/puppetlabs-zfs_core.pot
  5. +1 −1 metadata.json
10 changes: 9 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,15 @@

All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org).

## [1.0.3](https://github.com/puppetlabs/puppetlabs-zfs_core/tree/1.0.3) (2019-10-31)
## [1.0.4](https://github.com/puppetlabs/puppetlabs-zfs_core/tree/1.0.4) (2019-11-06)

[Full Changelog](https://github.com/puppetlabs/puppetlabs-zfs_core/compare/1.0.3...1.0.4)

### Fixed

- \(MODULES-8823\) Better handling of ZFS overlay property on Linux [\#23](https://github.com/puppetlabs/puppetlabs-zfs_core/pull/23) ([GabrielNagy](https://github.com/GabrielNagy))

## [1.0.3](https://github.com/puppetlabs/puppetlabs-zfs_core/tree/1.0.3) (2019-11-01)

[Full Changelog](https://github.com/puppetlabs/puppetlabs-zfs_core/compare/1.0.2...1.0.3)

Expand Down
19 changes: 7 additions & 12 deletions lib/puppet/provider/zfs/zfs.rb
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def container_property
# aclmode was removed from S11 in build 139 but it may have been added back
# acltype is for ZFS on Linux, and allows disabling or enabling POSIX ACLs
# http://webcache.googleusercontent.com/search?q=cache:-p74K0DVsdwJ:developers.slashdot.org/story/11/11/09/2343258/solaris-11-released+&cd=13
[:aclmode, :acltype, :shareiscsi].each do |field|
[:aclmode, :acltype, :shareiscsi, :overlay].each do |field|
# The zfs commands use the property value '-' to indicate that the
# property is not set. We make use of this value to indicate that the
# property is not set since it is not available. Conversely, if these
Expand All @@ -79,17 +79,12 @@ def container_property
end
end

zfs_properties = [:aclinherit, :atime, :canmount, :checksum,
:compression, :copies, :dedup, :devices, :exec, :logbias,
:mountpoint, :nbmand, :primarycache, :quota, :readonly,
:recordsize, :refquota, :refreservation, :reservation,
:secondarycache, :setuid, :sharenfs, :sharesmb,
:snapdir, :version, :volsize, :vscan, :xattr]

# The overlay property is only supported on Linux
zfs_properties << :overlay if Facter.value(:kernel) == 'Linux'

zfs_properties.each do |field|
[:aclinherit, :atime, :canmount, :checksum,
:compression, :copies, :dedup, :devices, :exec, :logbias,
:mountpoint, :nbmand, :primarycache, :quota, :readonly,
:recordsize, :refquota, :refreservation, :reservation,
:secondarycache, :setuid, :sharenfs, :sharesmb,
:snapdir, :version, :volsize, :vscan, :xattr].each do |field|
define_method(field) do
zfs(:get, '-H', '-o', 'value', field, @resource[:name]).strip
end
Expand Down
8 changes: 5 additions & 3 deletions lib/puppet/type/zfs.rb
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,11 @@ module Puppet
desc 'The nbmand property. Valid values are `on`, `off`.'
end

if Facter.value(:kernel) == 'Linux'
newproperty(:overlay) do
desc 'The overlay property. Valid values are `on`, `off`.'
newproperty(:overlay) do
desc 'The overlay property. Valid values are `on`, `off`.'

validate do |_value|
raise Puppet::Error _('This property is only supported on Linux') unless Facter.value(:kernel) == 'Linux'
end
end

Expand Down
15 changes: 9 additions & 6 deletions locales/puppetlabs-zfs_core.pot
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) 2018 Puppet, Inc.
# Copyright (C) 2019 Puppet, Inc.
# This file is distributed under the same license as the puppetlabs-zfs_core package.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2018.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2019.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: puppetlabs-zfs_core 1.0.0-5-g43d6225\n"
"\n"
"Project-Id-Version: puppetlabs-zfs_core \n"
"Report-Msgid-Bugs-To: docs@puppet.com\n"
"POT-Creation-Date: 2018-08-20 08:41-0700\n"
"PO-Revision-Date: 2018-08-20 08:41-0700\n"
"POT-Creation-Date: 2019-11-05 08:19+0000\n"
"PO-Revision-Date: 2019-11-05 08:19+0000\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language: \n"
Expand All @@ -19,6 +18,10 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"

#: ../lib/puppet/type/zfs.rb:83
msgid "This property is only supported on Linux"
msgstr ""

#: ../lib/puppet/type/zpool.rb:68
msgid "mirror names must be provided as string separated, not a comma-separated list"
msgstr ""
Expand Down
2 changes: 1 addition & 1 deletion metadata.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "puppetlabs-zfs_core",
"version": "1.0.3",
"version": "1.0.4",
"author": "puppetlabs",
"summary": "Manage zfs. Create destroy and set properties on zfs instances.",
"license": "Apache-2.0",
Expand Down