-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
(MODULES-8823) Add support for overlay option in zfs on Linux #22
Conversation
This option allows mounting over non empty directories. The current master of zfs_core simply doesn't implement such option on the zfs resource. This change allows for specification of such option in puppet modules: zfs { 'my_pool/my_volume': ensure => present, mountpoint => '/mnt/non_empty_dir', overlay => 'on' }
newproperty(:overlay) do | ||
desc 'The overlay property. Valid values are `on`, `off`.' | ||
end | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This code is unfortunately executed on the server during compilation and the agent during catalog application. So this unfortunately means you can only set this property if the puppetserver is also running on Linux. I think you'd be better off always defining the overlay
property, and then add a validate
method within the overlay
property to fail if the agent kernel is not Linux:
newproperty(:overlay) do
desc ...
validate do |value|
if Facter.value(:kernel) != 'Linux'
fail("The overlay property is unsupported")
end
end
end
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@joshcooper isn't puppetserver only available on Linux platforms though?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried at first with your suggestion, but due to the way the properties are treated in the provider it still gets executed on Solaris... oh well
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We provide puppetserver packages for linux variants, but you can run puppetserver from any POSIX server provided you have Java.
It seems like the zfs module already handles "conditional" properties. Probably should add overlay
to
[:aclmode, :acltype, :shareiscsi].each do |field| |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, I'll give that a try on Monday.
Fixed up @kali-hernandez's commit by only adding this parameter if we're running on Linux.
Adds back #20