To reproduce:
- mount EXPORT on MOUNTPOINT manually (NOT adding it to fstab)
- run puppet on the following .pp:
mount { "MOUNTPOINT":
atboot => no,
blockdevice => "-",
device => "EXPORT",
ensure => mounted,
fstype => nfs,
options => $kernel ? {
linux => noauto,
sunos => "-"
},
pass => $kernel ? {
linux => 0,
sunos => "-"
},
dump => 0,
}
Expected changes:
- export stays mounted on MOUNTPOINT
- a proper line gets appended to fstab
Actual changes:
- export stays mounted on MOUNTPOINT
- fstab gets rebuilt, but without any semantic change (i.e. timestamp is updated, but the line not added to the file)
After adding the following debugging code to provider/parsedfile.rb flush_target(),
I noticed that the entry to be added has "ensure => absent" rather than the specified "mounted"
if target == '/etc/fstab'
Puppet.notice target_records(target).inspect
end
Adding a line to the fstab manually makes puppet work as expected,
so we concluded that the lack of the line in fstab makes puppet confused.
Unfortunately due to the lack of knowledge on how providers/types work exactly,
I wasn't able to investigate it any further.
(We used NFS and tested on Linux, but I don't think that matters)