Hello,
I have a use case where I'm trying to set a default variable for a defined type parameter that's unfortunately fairly nested. Perhaps there's an obvious solution for this that I'm missing, but I'm not finding it.
In my specific use case, we're trying to have the puppetlabs-lvm class managed wholly in hiera, with an example as follows:
lvm::volume_groups:
Volume00:
physical_volumes:
- /dev/sda3
logical_volumes:
root:
size: 2G
mountpath: /
fs_type: xfs
usr:
size: 4G
mountpath: /
options: defaults,nodev
fs_type: xfs
And so forth. Unfortunately, it gets cumbersome setting fs_type to xfs for every single mount, especially when spread across multiple yamls. Unfortunately, the puppetlabs-lvm logical_volume.pp is a defined type that defaults fs_type to ext4, and I'm not sure how to override that as a default without having to enter it in for every single filesystem.
Is there any way to do this, or does it need to be done specifically for every single filesystem? I think it's a bit too nested for a wrapper class that calls create_resources('lvm::volume_groups', $my_filesystems, $my_defaults) or similar, I think I'd have to instead create at least two wrappers which I'd rather avoid and keep this as simple as practical.
So, I suppose in summary the question is if there's any way to effectively globally override a defined type's parameter default value solely in hiera and without writing wrapper classes?
Thanks,
-stefan