Thanks for your return.

It is noted that hiera your search directly in the common.yaml, it is not 
your path hierarchy.

 

Here's an example search or hiera good in the order of hierarchy:

My hierarchy is:


:hierarchy:

  - "node/%{fqdn}"

  - "virtual/%{virtual}"

  - "osfamily/%{osfamily}"

  - common

 

 

# hiera -d -m toto.local sudo::configs

DEBUG: Fri Sep 04 11:36:29 +0000 2015: Hiera YAML backend starting

DEBUG: Fri Sep 04 11:36:29 +0000 2015: Looking up sudo::configs in YAML 
backend

DEBUG: Fri Sep 04 11:36:29 +0000 2015: Looking for data source *node*
/toto.local

DEBUG: Fri Sep 04 11:36:29 +0000 2015: Cannot find datafile 
*/etc/puppet/hieradb/node*/ toto.local .yaml, skipping

DEBUG: Fri Sep 04 11:36:29 +0000 2015: Looking for data source *virtual/*
vmware

DEBUG: Fri Sep 04 11:36:29 +0000 2015: Cannot find datafile 
*/etc/puppet/hieradb/virtual/*vmware.yaml, skipping

DEBUG: Fri Sep 04 11:36:29 +0000 2015: Looking for data source *osfamily*
/RedHat

DEBUG: Fri Sep 04 11:36:29 +0000 2015: Cannot find datafile 
*/etc/puppet/hieradb/osfamily*/RedHat.yaml, skipping

DEBUG: Fri Sep 04 11:36:29 +0000 2015: Looking for data source *common*

DEBUG: Fri Sep 04 11:36:29 +0000 2015: *Found sudo::configs in common*

{"toto"=>{"content"=>"toto ALL=(ALL) NOPASSWD: ALL"}}

 

 

 

So check the following:

1 / verifies that the file points /etc/hiera.yaml of your file 
 /etc/puppet/hiera.yaml:

ls -rtla /etc/hiera.yaml

     /etc/hiera.yaml -> /etc/puppet/hiera.yaml

 

2 / Check the owners:

Chown puppet: puppet /etc/puppet/hiera.yaml

Chown -R puppet: puppet / etc / puppet / hieradata /

 

Restart your instance Puppet Master for the changes to take effect.






Le vendredi 4 septembre 2015 12:21:15 UTC+2, Alfredo De Luca a écrit :
>
> Hi David. 
> Here is the output. 
> [root@puppet-server puppet]# hiera -d postgresql::server 
> DEBUG: Fri Sep 04 20:18:29 +1000 2015: Hiera YAML backend starting 
> DEBUG: Fri Sep 04 20:18:29 +1000 2015: Looking up postgresql::server 
> in YAML backend 
> DEBUG: Fri Sep 04 20:18:29 +1000 2015: Looking for data source common 
> nil 
> [root@puppet-server puppet]# hiera -d postgresql::server 
> DEBUG: Fri Sep 04 20:19:04 +1000 2015: Hiera YAML backend starting 
> DEBUG: Fri Sep 04 20:19:04 +1000 2015: Looking up postgresql::server 
> in YAML backend 
> DEBUG: Fri Sep 04 20:19:04 +1000 2015: Looking for data source common 
> nil 
>
> [root@puppet-server puppet]# 
> [root@puppet-server puppet]# hiera -d sudo::configs fqdn=
> puppet-sql.alflab.net 
> DEBUG: Fri Sep 04 20:19:17 +1000 2015: Hiera YAML backend starting 
> DEBUG: Fri Sep 04 20:19:17 +1000 2015: Looking up sudo::configs in YAML 
> backend 
> DEBUG: Fri Sep 04 20:19:17 +1000 2015: Looking for data source common 
> nil 
> [root@puppet-server puppet]# hiera -d -a postgresql::server 
> fqdn=puppet-sql.alflab.net 
> DEBUG: Fri Sep 04 20:19:23 +1000 2015: Hiera YAML backend starting 
> DEBUG: Fri Sep 04 20:19:23 +1000 2015: Looking up postgresql::server 
> in YAML backend 
> DEBUG: Fri Sep 04 20:19:23 +1000 2015: Looking for data source common 
> nil 
> [root@puppet-server puppet]# hiera -d -h postgresql::server 
> fqdn=puppet-sql.alflab.net 
> DEBUG: Fri Sep 04 20:19:31 +1000 2015: Hiera YAML backend starting 
> DEBUG: Fri Sep 04 20:19:31 +1000 2015: Looking up postgresql::server 
> in YAML backend 
> DEBUG: Fri Sep 04 20:19:31 +1000 2015: Looking for data source common 
> nil 
>
>
> On Fri, Sep 4, 2015 at 2:06 AM, David Levray <dle...@gmail.com 
> <javascript:>> wrote: 
> > In  /etc/puppet/hieradata/nodes/ create a file 
> 'puppet-sql.alflab.net.yaml' 
> > that contains: 
> > 
> > --- 
> > postgresql::server: 
> > 
> > 
> > restart your instance PuppetMaster (service httpd/apache2 restart) 
> > Then we test hiera debug mode if it finds the information: 
> > 
> > hiera -d postgresql::server 
> > hiera -d sudo::configs fqdn=puppet-sql.alflab.net 
> > 
> > or (for array) 
> > hiera -d -a postgresql::server fqdn=puppet-sql.alflab.net 
> > 
> > or (for hash): 
> > hiera -d -h postgresql::server fqdn=puppet-sql.alflab.net 
> > 
> > 
> > Can you give the return orders, please 
> > 
> > 
> > 
> > 
> > 
> > 
> > Le samedi 29 août 2015 06:31:29 UTC+2, Alfredo De Luca a écrit : 
> >> 
> >> Hi all. 
> >> Using Puppet open source  3.8  with hiera for test purpose. 
> >> 
> >> I installed puppetlabs-postgresql from forge but when on my puppet 
> >> client yaml I use postgresql I got the following error: 
> >> 
> >> 
> >> Error: Could not retrieve catalog from remote server: Error 400 on 
> >> SERVER: Could not find class postgresql for puppet-sql.alflab.net on 
> >> node puppet-sql.alflab.net 
> >> 
> >> 
> >> Any clue why? 
> >> 
> >> Here is the yaml file 
> >> 
> >> --- 
> >> classes: 
> >>   - sudo 
> >>   - selinux 
> >>   - postgresql 
> >> 
> >> All the rest is working just fine. Also I tried puppetlabs-mysql but 
> >> same error. 
> >> 
> >> Regards 
> >> 
> >> -- 
> >> Alfredo 
> > 
> > -- 
> > 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...@googlegroups.com <javascript:>. 
> > To view this discussion on the web visit 
> > 
> https://groups.google.com/d/msgid/puppet-users/6a741c4e-35ad-43c2-bb2d-3c48c7bc558c%40googlegroups.com.
>  
>
> > 
> > For more options, visit https://groups.google.com/d/optout. 
>
>
>
> -- 
> Alfredo 
>

-- 
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/e9614e98-4052-484b-8f14-abe6634a2238%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to