After doing an analysis of the code, most particularly lib/puppet/type/mount.rb it appears that the problem doesn’t lie with puppet but with cifs-utils.
When puppet does a ‘mount -o remount’, it triggers a bug in cifs-utils that makes a double entry in /etc/mtab. This is the commit of the fix for this bug :
“During a remount of a cifs filesystem, the mtab file is not properly updated, which leads to a doubled entry of the same filesystem in the /etc/mtab file. This patch adds a new function del_mtab() which is called before the add_mtab() in case the fs is being remounted.”
A potential workaround is to use remounts => ‘false’ but a safer solution would be to get a version of cifs-utils higher than 5.3 :
transcript from the upstream bug report :
After doing an analysis of the code, most particularly lib/puppet/ type/mount. rb it appears that the problem doesn’t lie with puppet but with cifs-utils.
When puppet does a ‘mount -o remount’, it triggers a bug in cifs-utils that makes a double entry in /etc/mtab. This is the commit of the fix for this bug :
http:// git.samba. org/?p= cifs-utils. git;a=commit; h=f46dd7661cfb8 7257c95081fc207 1c934bfbbb16
“During a remount of a cifs filesystem, the mtab file is not properly updated, which leads to a doubled entry of the same filesystem in the /etc/mtab file. This patch adds a new function del_mtab() which is called before the add_mtab() in case the fs is being remounted.”
A potential workaround is to use remounts => ‘false’ but a safer solution would be to get a version of cifs-utils higher than 5.3 :
https:/ /lists. samba.org/ archive/ samba/2012- January/ 165958. html
To confirm this outside of puppet control, simply do the following :
$ mount //sambahost/test /mnt/target
$ mount -o remount /mnt/target
$ df | grep target
//sambahost/test 7033648 1278120 5402660 20% /mnt/target
//sambahost/test 7033648 1278120 5402660 20% /mnt/target