On Thu, Mar 03, 2011 at 07:38:28PM -0800, Forrie wrote:
> I'm trying to figure out how to manage the NFS mounts, then 'unmanage'
> them when we're done -- ie: remove the NFS mount (ensure => absent)
> and make sure the mount point on the client is removed.
> 
> I thought for the mount{} portion of this and loop over it.  But it's
> not a big deal, I don't mind editing them manually for now.
> 
> So are you saying for the "absent" items, we'll need to include a
> file{} directive to remove the mount point, too?
> 
yes. And remember to put a require in there because you don't want to
purge the mountpoint when umounting failed. Can turn out pretty bad
for NFS mounts you need elsewhere ;-)


    # Creation
    file { '/mnt/foo': ensure => directory }
    mount { '/mnt/foo':
      device  => ...,
      ensure  => mounted,
      require => File['/mnt/foo'],
    }

    # Delete (i think force is needed here)
    file { '/mnt/foo': ensure => absent, force => true}
    mount { '/mnt/foo':
      ensure => absent,
      before => File['/mnt/foo'],
    }

-Stefan

Attachment: pgppY0mGvvljw.pgp
Description: PGP signature

Reply via email to