problem solved I just was using hiera of the wrong way, I was using
hiera($conf_ntp)
instead hiera('conf_ntp'), I need to provide a keyname that hiera should
look up as a string.So , the error indicates that I was trying to look up a
key that is stored in `$conf_ntp` and $conf_ntp is not set to a value so
hiera tries to lookup an empty key.
On Saturday, March 22, 2014 3:09:49 PM UTC-3, Renan Vicente wrote:
>
> How can I check this , 'Cause in my nodes I received this?
>
> Error: Could not retrieve catalog from remote server: Error 400 on SERVER:
> Could not find data item in any Hiera data file and no default supplied at
> /etc/puppet/modules/ananke-base-utils/manifests/init.pp:42 on node
> tm-ld168-senacWarning: Not using cache on failed catalogError: Could not
> retrieve catalog; skipping run
>
> this is the part of my code that I am having trouble:
>
> 38 class ananke-base-utils {
> 39
> 40 # variables from hiera
> 41
> 42 $conf_file = hiera($conf_ntp)
> 43 $cpath_ntp = hiera($conf_ntp_path)
> 44 $cpath_vim = hiera($conf_vim_path)
> 45 $package_name = hiera_array($packages_utils)
> 46
> 47
> 48 # install package based on distribuition
> 49 package {$package_name:
> 50 ensure => 'present',
> 51 }
> 52
>
>
>
> On Friday, March 21, 2014 9:01:35 PM UTC-3, Jose Luis Ledesma wrote:
>>
>> The hiera command doesn't use facter, its a tool to check the values
>> returned by hiera in different circumstances.
>> El 21/03/2014 21:19, "Renan Vicente" <[email protected]> escribió:
>>
>>> Any one had this problem to find a attribute or know how to solve this?
>>> In my case I separated hiera files by osfamily when I execute
>>>
>>> # hiera packages_utils
>>>
>>> return me
>>>
>>> nil
>>>
>>> BUT if I execute
>>>
>>> # hiera packages_utils osfamily=Debian
>>>
>>> it's works
>>>
>>> ["tzdata",
>>> "dnsutils",
>>> "bash-completion",
>>> "unzip",
>>> "bzip2",
>>> "htop",
>>> "vim",
>>> "ntpdate",
>>> "mlocate",
>>> "nfs-common",
>>> "sysstat"]
>>>
>>> the facter osfamily works.
>>>
>>> # facter osfamily
>>> Debian
>>>
>>> my hiera.yaml
>>>
>>> ---
>>> :backends:
>>> - yaml
>>> :hierarchy:
>>> - "nodes/%{fqdn}"
>>> - "osfamily/%{osfamily}"
>>> - "osfamily/%{operatingsystem}"
>>> - defaults/users
>>> - defaults/hosts
>>> - "%{clientcert}"
>>> - "%{environment}"
>>> - global
>>>
>>> :yaml:
>>> # datadir is empty here, so hiera uses its defaults:
>>> # - /var/lib/hiera on *nix
>>> # - %CommonAppData%\PuppetLabs\hiera\var on Windows
>>> # When specifying a datadir, make sure the directory exists.
>>> :datadir: /etc/puppet/hiera
>>>
>>> my osfamily directory content
>>>
>>> # ls -l /etc/puppet/hiera/osfamily/
>>> total 12
>>> lrwxrwxrwx 1 root root 11 Mar 21 15:44 CentOS.yaml -> RedHat.yaml
>>> -rw-r--r-- 1 root root 248 Mar 21 16:11 Debian.yaml
>>> -rw-r--r-- 1 root root 29 Mar 21 16:13 default.yaml
>>> -rw-r--r-- 1 root root 223 Mar 21 15:44 RedHat.yaml
>>> lrwxrwxrwx 1 root root 11 Mar 21 15:44 Ubuntu.yaml -> Debian.yaml
>>>
>>> my Debian.yaml
>>>
>>> ---
>>> packages_utils:
>>> - tzdata
>>> - dnsutils
>>> - bash-completion
>>> - unzip
>>> - bzip2
>>> - htop
>>> - vim
>>> - ntpdate
>>> - mlocate
>>> - nfs-common
>>> - sysstat
>>> conf_ntp:
>>> - ntpdate
>>> conf_ntp_path:
>>> - /etc/default/ntpdate
>>> conf_vim_path:
>>> - /etc/vim/vimrc
>>>
>>> --
>>> 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/11625c93-4c89-4fd6-8c82-6b9c170ebddb%40googlegroups.com<https://groups.google.com/d/msgid/puppet-users/11625c93-4c89-4fd6-8c82-6b9c170ebddb%40googlegroups.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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/puppet-users/7f42c2a8-81a0-4a9b-8d9b-42ca06305883%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.