FAQ
still pretty new to Ruby, please bare with me :) Say I have a module
with a custom type, structured like so:

[modules]/mymodule/manifests/init.pp
[modules]/mymodule/lib/puppet/provider/mytype/foo.rb
[modules]/mymodule/lib/puppet/type/mytype.rb

In foo.rb, I'd like to call some custom ruby functions in a module and/
or class. These are generic functions that may be used in other
modules, e.g. md5.rb with a collection of MD5 functions/methods.

I was thinking a generic 'custom' module laid out something like

[modules]/custom/lib/puppet/md5.rb
[modules]/custom/lib/puppet/networking.rb

What's the best place to put these so they get autoloaded by
pluginsync, and what is the preferred approach for namespacing?
Basically how do I require these within other modules.

Poking around the forge, I've seen things like

[modules]/custom/lib/puppet/util/md5.rb

and

[modules]/custom/lib/puppet/modules/md5.rb

But often there seem to be hacks used to load these.

Regards,

Adam

--
You received this message because you are subscribed to the Google Groups "Puppet Users" group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.

Search Discussions

  • Ad at Jul 10, 2012 at 3:08 am
    how bout a basic 2 modules one which calls a function in the other
    example?
    On Jul 9, 5:23 pm, ad wrote:
    still pretty new to Ruby, please bare with me :) Say I have a module
    with a custom type, structured like so:

    [modules]/mymodule/manifests/init.pp
    [modules]/mymodule/lib/puppet/provider/mytype/foo.rb
    [modules]/mymodule/lib/puppet/type/mytype.rb

    In foo.rb, I'd like to call some custom ruby functions in a module and/
    or class. These are generic functions that may be used in other
    modules, e.g. md5.rb with a collection of MD5 functions/methods.

    I was thinking a generic 'custom' module laid out something like

    [modules]/custom/lib/puppet/md5.rb
    [modules]/custom/lib/puppet/networking.rb

    What's the best place to put these so they get autoloaded by
    pluginsync, and what is the preferred approach for namespacing?
    Basically how do I require these within other modules.

    Poking around the forge, I've seen things like

    [modules]/custom/lib/puppet/util/md5.rb

    and

    [modules]/custom/lib/puppet/modules/md5.rb

    But often there seem to be hacks used to load these.

    Regards,

    Adam
    --
    You received this message because you are subscribed to the Google Groups "Puppet Users" group.
    To post to this group, send email to puppet-users@googlegroups.com.
    To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com.
    For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppuppet-users @
categoriespuppet
postedJul 9, '12 at 10:23p
activeJul 10, '12 at 3:08a
posts2
users1
websitepuppetlabs.com

1 user in discussion

Ad: 2 posts

People

Translate

site design / logo © 2021 Grokbase