When using cli you want to tell hiera to look up all hashes:

hiera -h site_users fqdn=myhost

On 08 Jan 2015, at 17:02, Raphael <[email protected]> wrote:

> Oh yeah ! Sorry for this noise ! The manifest on my nodes applyed properly 
> ... and I've got the the proper output from cli with the facts provided.
> 
> Regarding the lookup, here what I have :
> 
> Based on https://docs.puppetlabs.com/hiera/1/lookup_types.html
> 
> hiera site_users
> {"bob"=>{"uid"=>501, "shell"=>"/bin/bash"},
>  "ash"=>{"uid"=>502, "shell"=>"/bin/zsh", "group"=>"common"}}
> 
> 
> hiera site_users ::fqdn=myhost
> {"jen"=>{"uid"=>503, "shell"=>"/bin/zsh", "group"=>"deglitch"},
>  "bob"=>{"uid"=>1000, "group"=>"deglitch"}}
> 
> My hiera.yaml settings :
> 
> :hierarchy:
> 
>   - "node/%{::fqdn}"
>   - common
> 
> :merge_behavior: deeper
> 
> What did I miss ?
> 
> 
> 
> Le jeudi 8 janvier 2015 15:23:10 UTC+1, Johan De Wit a écrit :
> Hi Raphael, 
> hiera smtpserver domain=example.com
> 
> 
> That should work.  If using hiera from CLI, you need to provide the facts etc 
> also.
> 
> See the docs : 
> https://docs.puppetlabs.com/hiera/1/command_line.html
> 
> hth 
> 
> johan
> 
> 
> On 08/01/15 09:52, Raphael wrote:
>> Hi,
>> I have a working puppetmaster installed from package on an ubuntu server 
>> 14.04 64bits.
>> I've been struggeling for a while now with hiera to achieve what it is 
>> written in the doc ;
>> 
>> My hiera version is 1.3.0
>> Puppetmaster version 3.4.3
>> 
>> My hierachy settings is quite simple, with a common file and a specific file 
>> for host : 
>> 
>> ---
>> :backends:
>>   - yaml
>>   - json
>> :yaml:
>>   :datadir: /etc/puppet/hieradata
>> :json:
>>   :datadir: /etc/puppet/hieradata
>> :hierarchy:
>> 
>>   - common
>>   - "node/%{::fqdn}"
>> 
>> :merge_behavior: deeper
>> 
>> This file is in /etc/puppet/ and linked to /etc/hiera.yaml
>> 
>> In the common.yaml, I'm trying to use a variable based on facts (like in the 
>> example on the official documentation) :
>> 
>> 
>> smtpserver: "mail.%{::domain}"
>> 
>> When I issue hiera smtpserver, I have this output :
>> 
>> 
>> mail.
>> 
>> Even the lookup type (deeper here in my config) doesn t provide the same 
>> output as the example ...
>> 
>> Any idea ? version issue ?
>> 
>> Thx a lot for your advice / answer.
>> 
>> -- 
>> 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 [email protected].
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/puppet-users/3590c684-299f-4775-a12a-f241ab06f75d%40googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
> 
> 
> -- 
> Johan De Wit
> 
> Open Source Consultant
> 
> Red Hat Certified Engineer              (805008667232363)
> Puppet Certified Professional 2013/2014 (PCP0000006)
> blog : 
> http://johan.koewacht.net/
> 
> ______________________________
> ___________________________
>  
> Open-Future                 Phone     +32 (0)2/255 70 70
> Zavelstraat 72              Fax       +32 (0)2/255 70 71
> 3071 KORTENBERG             Mobile    +32 (0)474/42 40 73
> BELGIUM                     
> http://www.open-future.be
> 
> ______________________________
> ___________________________
>  
> 
> 
> Upcoming Events:
> 
> Zabbix Certified Specialist | 
> http://www.open-future.be/zabbix-certified-professional-training-8th-till-9th-janaury
> 
> Zabbix Certified Professional | 
> http://www.open-future.be/zabbix-certified-professional-training-8th-till-9th-janaury
> 
> Bacula Administrator 1 | 
> http://www.open-future.be/bacula-administrator-i-training-13th-till-15th-january
> 
> Puppet Fundamentals | 
> http://www.open-future.be/puppet-fundamentals-training-26th-till-28th-january
> 
> Puppet Architect | 
> http://www.open-future.be/puppet-architect-training-29th-till-30th-january
> 
> Subscribe to our newsletter: http://eepurl.com/BUG8H
> 
> 
> 
> -- 
> 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 [email protected].
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/puppet-users/1f7b7077-33bd-4511-bb81-396ffff96c2b%40googlegroups.com.
> 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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/8F175A26-EF5B-4D75-A16A-D704B9A6F7F9%40gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to