Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I defined a simple class for mount a nfs share on host as follow(current)

class mounts {
    file { [ "/mnt/share", "/mnt/share/share1" ]:
    ensure => 'directory',
    }

    mount { '/mnt/share/share1':
    ensure  => 'mounted',
    device  => '192.168.122.1:/home/export',
    dump    => '0',
    fstype  => 'nfs',
    options => 'vers=3,defaults',
    pass    => '0',
    require => File[ "/mnt/share", "/mnt/share/share1" ],
    }
}

So now i have an entry in /etc/fstab on the puppet client

192.168.122.1:/home/export      /mnt/share/share1       nfs     vers=3,defaults 0       0

My problem is, the puppet class was defined in this way(OLD)

class mounts {
    file { '/mnt/nfs':
    ensure => 'directory',
    }

    mount { '/mnt/nfs':
    ensure  => 'mounted',
    device  => '192.168.122.1:/home/export',
    dump    => '0',
    fstype  => 'nfs',
    options => 'vers=3,defaults',
    pass    => '0',
    require => File[ "/mnt/nfs" ],
    }
}

And now i have two entries in the /etc/fstab

192.168.122.1:/home/export      /mnt/nfs        nfs     vers=3,defaults 0       0 #OLD
192.168.122.1:/home/export      /mnt/share/share1       nfs     vers=3,defaults 0       0 #NEW

why puppet doesn't remove the old entry?

share|improve this question

1 Answer 1

up vote 7 down vote accepted

Puppet doesn't automatically remove something, just because it managed a setting in the past and the old resource no longer applies.

If you want to remove that old mount, then remove it with a with something like this.

mount { '/mnt/nfs':
  ensure  => absent,
}
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.