David,

You'll need to use confine statements to set the suitability of a
particular provider to the OS.

See:
http://projects.puppetlabs.com/projects/1/wiki/Development_Provider_Developmentunder
'Suitability'.

The new Types and Providers book covers this reasonably well also.

Finally, take a look at the 'group' provider in the Puppet core code to see
how they go between Windows and other OS's.

Good Luck!

Trevor


On Wed, May 29, 2013 at 5:40 AM, David Campos <[email protected]
> wrote:

> Hello all,
>
> I am developing a few custom providers for some features that I need into
> my system (such as dealing with different zipped files or generating some
> JSON data based on OS files) and I have hit into a question about "how to
> do this for multiple OS?"
>
> Lets focus into the zipped file provider that should provide a common
> method to pack or unpack zipped files (tar, tar.gz, rar, zip or any) backed
> on OS tools or native ruby methods. Maybe the ruby approach would be the
> most portable one but I will keep that approach aside right now. We end up
> with 3 providers for the custom type 'zipfile': zip, rar and tar.
>
> Those providers may share code but they differ on how to delegate its
> functionality to third-party apps (7zip on windows and zip/unzip on linux
> as an example). How can I deal with that? Can I clone the provider into
> different files such as zip-windows.rb and zip-linux.rb, keep the same
> header and use the confine method? Is there any filename -> provider
> restriction? Is that the correct approach?
>
> I have been searching through other core providers like file but I can not
> find my answer...
>
> Thanks
>
> --
> 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 [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/puppet-users?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>



-- 
Trevor Vaughan
Vice President, Onyx Point, Inc
(410) 541-6699
[email protected]

-- 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 [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/puppet-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to