Re: [Puppet Users] Hiera error apply catalog

23 views
Skip to first unread message

Garrett Honeycutt

unread,
Apr 28, 2014, 5:15:39 PM4/28/14
to puppet...@googlegroups.com
On 4/28/14, 5:06 PM, mike wrote:
> Hi everyone,
> I learning Hiera for my Puppet configuration but I've the error when i
> execute the node connection.
>
> [....................]
> Error: Could not retrieve catalog from remote server: Error 400 on
> SERVER: Could not find data item apache_package in any Hiera data file
> and no default supplied at
> /etc/puppet/modules/apache/manifests/init.pp:2 on node node2.example.com
> Warning: Not using cache on failed catalog
> Error: Could not retrieve catalog; skipping run
> [....................]
>
> But when i check data depending returns nil
>
> [....................]
> [root@master puppet]# hiera -c hiera.yaml apache_package osfamily=Debian
> nil
> [root@master puppet]# hiera -c hiera.yaml apache_package osfamily=RedHat
> nil
> [....................]
>
> Hiera yaml file
>
> [....................]
> [root@master puppet]# cat hieradata/RedHat.yaml
> ­­­
> apache_package: 'httpd'
> apache_service: 'httpd'
>
> [root@master puppet]# cat hieradata/Debian.yaml
> ­­­
> apache_package: 'apache2'
> apache_service: 'apache'
> [....................]
>
> [....................]
> [root@master puppet]# cat hiera.yaml
> ---
> :backends: - yaml
>
> :hierarchy:
> - %{osfamily}
> - common
>
> :yaml:
> :datadir: /etc/puppet/hieradata/
> [....................]
>
> Thanks.

Hi,

Check that /etc/puppet/hiera.yaml and /etc/hiera.yaml are both symlinks
to /var/lib/hiera/hiera.yaml.

Best regards,
-g


--
Garrett Honeycutt
@learnpuppet
Puppet Training with LearnPuppet.com
Mobile: +1.206.414.8658
Reply all
Reply to author
Forward
0 new messages