Thanks for the suggestion. Looking for a non-existent key sounds like a
decent work around for now. Thanks a lot for the help! :)

Vaidik Kapoor
vaidikkapoor.info

On 1 October 2014 21:27, Nan Liu <nan....@gmail.com> wrote:

> On Wed, Oct 1, 2014 at 5:42 AM, Vaidik Kapoor <kapoor.vai...@gmail.com>
> wrote:
>
>> Hi Guys,
>>
>> I am using masterless Puppet. And My situation is that I am using a
>> custom Hiera backend called hiera-regex. The process of using it is that
>> you have to have hiera-regex installed on your target machine.
>>
>> If sometime for some reason, hiera-regex is not installed, hiera still
>> looks up for the key in hierarchy and starts using that key which it was
>> not suppose to use in the presence of hiera-regex. Ideally, I would want
>> Puppet to exit when it does not find hiera-regex backend installed. But
>> as of now, Puppet only prints a notice() which can be easily missed and can
>> leave your node in an unwanted state.
>>
>> Is it possible to somehow configure Puppet/hiera for masterless setup to
>> not continue at all if hiera is configured to use a custom backend and that
>> backend is not installed?
>>
>> Here is my hiera.yaml file:
>>
>> ---
>> :backends:
>>     - regex  # this is the custom backend (hiera-regex)
>>     - yaml
>>
>> :regex:
>>     :datadir: /etc/puppet/hiera
>>
>> :yaml:
>>     :datadir: /etc/puppet/hiera
>>
>> :hierarchy:
>>     - "%{fqdn}"
>>     - base
>>
>>
>> Expecting some help on this. I have posted the same question on
>> stackoverflow as well:
>> http://stackoverflow.com/questions/26133604/exit-puppet-when-hiera-backend-is-not-found
>>
>
> Perform a data lookup for a non relevant key that only exists in the
> hiera-regex backend or fail the catalog.
>
> if !hiera('hiera::regex') { fail('hiera-regex backend does not appear to
> be loaded') }
>
> Nan
>
> --
> 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 puppet-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/puppet-users/CACqVBqCf%2BnF9wFp-5Q4rWMZ%2B5wHNjxeLbdpxr_G%2BMRTkUMTM8A%40mail.gmail.com
> <https://groups.google.com/d/msgid/puppet-users/CACqVBqCf%2BnF9wFp-5Q4rWMZ%2B5wHNjxeLbdpxr_G%2BMRTkUMTM8A%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/CACWtv5%3DPAmrp9C_UAbS_JSvztitFVdn7e4q9THEA7TG2p9pEfg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to