Puppet filebucketing fail with NFS

I’ve got back to Australia and I’m continuing my UK job from home.

So yesterday, I was doing some cleaning up and needed to unmount an NFS share and clean up its mount point directory.

You can see from the Puppet code below that I marked both resources as ‘absent’ to clean them up.

file { '/tmp/install':
    ensure   => 'absent'
mount { '/tmp/install':
    ensure   => 'absent',
    device   => nfs-server:/install,
    fstype   => nfs

This triggered Puppet to start filebucketing everything it could from the NFS share and subsequently filling up the root filesystem. I managed to revert my commit fairly quickly, but a large number of hosts in our infrastructure had already picked this up. This included both development and production systems.

There is an existing Puppet bug report about the issue at http://projects.puppetlabs.com/issues/2019

Apart from the obvious mistake that I should have just run this in a test environment first, this was totally unexpected behaviour.

A couple of things you could do to prevent this happening to you:

  1. Disable filebucketing either globally, or just for this file resource
  2. Don’t try to remove the NFS mount and directory at the same time

Hope this helps.