Issue #7788 has been updated by Kelsey Hightower.

With this patch Puppet also supports loading parser functions via gems:

### autoloader-test.pp ###

    $port = hiera('port', 8888)

    notify {'autoloader test message':
      message => "Port: $port"
    }

Puppet apply without the `hiera-puppet` gem installed:

    $ puppet apply autoloader-test.pp 
    Error: Unknown function hiera at /workspace/puppet/autoloader-test.pp:1 on 
node dev.hightower.org
    Error: Unknown function hiera at /workspace/puppet/autoloader-test.pp:1 on 
node dev.hightower.org

Now install the `hiera-puppet` gem

    $ gem install hiera-puppet
    Fetching: hiera-puppet-0.3.0.gem (100%)
    Successfully installed hiera-puppet-0.3.0
    1 gem installed
    Installing ri documentation for hiera-puppet-0.3.0...
    Installing RDoc documentation for hiera-puppet-0.3.0...

Puppet apply with the `hiera-puppet` gem installed:

    $ puppet apply autoloader-test.pp
    Port: 8888
    /Stage[main]//Notify[autoloader test message]/message: defined 'message' as 
'Port: 8888'
    Finished catalog run in 0.03 seconds
----------------------------------------
Feature #7788: Puppet should allow rubygems to deliver new functionality
https://projects.puppetlabs.com/issues/7788#change-65574

Author: R.I. Pienaar
Status: In Topic Branch Pending Review
Priority: Normal
Assignee: Nigel Kersten
Category: plug-ins
Target version: 3.0.0
Affected Puppet version: 
Keywords: rubygems autoloader
Branch: https://github.com/puppetlabs/puppet/pull/873


It would be desirable to use Rubygems to install things like parser functions. 

There might be cases where you only want a function on the master, pluginsync 
would copy it everywhere and everywhere might not have the dependencies needed 
to run it.

If the autoloader considered the rubygem search path while autoloading this 
should allow gems to extend puppet.


-- 
You have received this notification because you have either subscribed to it, 
or are involved in it.
To change your notification preferences, please click here: 
http://projects.puppetlabs.com/my/account

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

Reply via email to