Pattern question for providers

17 views
Skip to first unread message

Jeff Bachtel

unread,
Dec 9, 2013, 12:12:29 PM12/9/13
to puppet...@googlegroups.com
When creating a provider that uses a command not in PATH, what is the best-practice pattern for case'ing out different potential locations? As an example, the puppetlabs rabbitmq pupmod has a rabbitmqplugins provider that falls down on CentOS using the rabbitmq upstream package due to rabbitmq-plugins being in /usr/lib/rabbitmq/bin

As an aside (I don't know how often Puppet devs read this list), could the Puppet::Util::which method perhaps be extended to add a non-user PATH-like variable to the path search string? Something like PUPPET_PROVIDER_PATH, if it exists, being concatenated before PATH. I could then configure the system environment on weird hosts to provide that variable for puppet without mucking with user/system PATH.

Thanks,

Jeff

Felix Frank

unread,
Dec 12, 2013, 4:12:12 AM12/12/13
to puppet...@googlegroups.com
On 12/09/2013 06:12 PM, Jeff Bachtel wrote:
> When creating a provider that uses a command not in PATH, what is the
> best-practice pattern for case'ing out different potential locations? As
> an example, the puppetlabs rabbitmq pupmod has a rabbitmqplugins
> provider that falls down on CentOS using the rabbitmq upstream package
> due to rabbitmq-plugins being in /usr/lib/rabbitmq/bin

As an initial thought, would it be feasible to alter the PATH for the
whole agent process, right from the provider code?

> As an aside (I don't know how often Puppet devs read this list), could
> the Puppet::Util::which method perhaps be extended to add a non-user
> PATH-like variable to the path search string? Something like
> PUPPET_PROVIDER_PATH, if it exists, being concatenated before PATH. I
> could then configure the system environment on weird hosts to provide
> that variable for puppet without mucking with user/system PATH.

Right, you may want to repost this question to the puppet-dev group.

Regards,
Felix
Reply all
Reply to author
Forward
0 new messages