As an alternate to Felix's proposal, you could write your own custom
provider that does the following:

*In the Property state query define*
- Collect all system resources of type Mount with type NFS into an instance
variable

*In the Property insync? method*
- Prune the list of system resources of type Mount with the list of Mount
NFS resources that are actually in your catalog
- Return that the property is in sync if the resultant list is empty, and
not otherwise

*In the Property sync method*
- Send the collected resources that need to be unmounted a signal to do so

This is very clean since it doesn't rely on any sort of inheritance model.
All you need are the system statements and the in-memory compiled catalog.
However, it is quite complex to get right.

Good luck!

Trevor

On Tue, Sep 9, 2014 at 8:57 AM, Andreas Zuber <zu...@puzzle.ch> wrote:

>
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Hello
>
> I just came across an interesting problem with the mount provider. We
> try to manage NFS mounts on the servers and purge all instances which
> are not in the catalog.
>
> Since the mount type/provider collects all the mounts it would simply
> destroy the system if we activate purging. So I started to look into
> different ways how this could be done right.
>
> Unfortunately I did not find a solution which is very attractive.
> Currently I simply copied the puppet mount type and provider and created
> a modified version of it under a different name. This is very ugly as it
> basically c&p some hundred lines of code to add a few lines which reject
> all non NFS mounts in the instances method.
>
> Is there a better way to do this? Is there some way I can limit the
> purging to a set of parameters or a specific provider for the mount
> type? Or is there a way to inherit a type and to inherit providers from
> such inherited types?
>
> Greetings
> Andreas
>
> - --
> Andreas Zuber
> Linux System-Ingenieur
> Puzzle ITC GmbH
> www.puzzle.ch
>
> Telefon +41 31 370 22 00
> Direkt  +41 31 370 22 49
> Mobile  +41 79 766 25 51
> Fax     +41 31 370 22 01
>
> Werfen Sie einen Blick in unseren Blog:
> <http://www.puzzle.ch/blog>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v2
>
> iEYEARECAAYFAlQO+ScACgkQc2hfmdKpdfXUyQCcC9lwZrmuh0YxR0p40XgEbxMo
> pLQAnAxoF6YyMuyFR8pgpVBt4qGEGBR/
> =j7we
> -----END PGP SIGNATURE-----
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Puppet Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to puppet-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/puppet-users/540EF927.8010407%40puzzle.ch
> .
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Trevor Vaughan
Vice President, Onyx Point, Inc
(410) 541-6699
tvaug...@onyxpoint.com

-- This account not approved for unencrypted proprietary information --

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/CANs%2BFoUs0U3_N_XhtGNGsLgTF31g2yWjTjuDNNWppPFFx5M7Xw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to