This could be shortened using this pattern

https://github.com/ghoneycutt/puppet-module-nfs/blob/master/manifests/init.pp#L12-L17

This removes the case statement and the validate_re, both of which would need spec tests.