Re: [Puppet Users] Determining if hiera (or any function) is installed on a node

Nigel Kersten
Tue, 17 Apr 2012 18:14:45 -0000

On Tue, Apr 17, 2012 at 11:08 AM, Geoff Davis <gadavis@ucsd.edu> wrote:

> I''m doing some work on module development inside of a Vagrant VM
of CentOS
> 6.2. This VM has the community version of Puppet installed (2.7.13 I
> think), but that doesn''t include Hiera by default.
>
> My module is dependent on Nan Liu''s puppet-staging module, which
requires
> hiera. This puts me into the proverbial chicken and egg problem of not
> having a puppet function but also not being able to install it with puppet,
> since my manifests don''t compile due to the hiera function not
being
> available.
>
> Right now, I''m doing a manual bootstrap of a new vagrant box with
a
> dedicated Puppet manifest that calls another one of Nan''s modules,
> puppet-hiera, to install hiera on the Vagrant VM, but I''d rather
use the
> same manifest for both bootstrap and module testing. I don''t care
if it
> takes two passes to converge, I just don''t want a freshly booted
Vagrant
> box to complain because it can''t compile it''s manifest.
>
> Is there a relatively foolproof way to determine if Puppet has a function
> available to it or not? Is there a "has_function" function
available in the
> Puppet DSL, or is there a check that I could roll into a fact that works
> cross-platform and between Puppet Enterprise and Community?
>
>
There''s a pending pull request in the stdlib module for adding a
function_available function