Hi Rob ,

On the puppet agent node, when I try to install ssh packages it is failing 
with "Error 400 on SERVER: Evaluation Error: Error while evaluating a 
Function Call, 
Could not find data item ssh_packages in any Hiera data file" error.
puppet agent -t works fine when modules does not contain hiera look ups. 
The issue seems hiera looksups is not working for puppet client/agent node.

However hiera lookups and ssh_packages working fine on master node when I 
use puppet apply -e 'include openssh:sshclient' module

Both puppet master and puppet client are using
# puppet --version
3.8.0 (Puppet Enterprise 3.8.0),

# hiera -v
1.3.4

On master node:
_______________

[root@pupmaster manifests]# puppet apply -e 'include openssh::sshclient'
Notice: Compiled catalog for pupmaster-dpallipa.idc.oracle.com in 
environment production in 5.77 seconds
Notice: /Stage[main]/Openssh::Sshclient/Package[openssh-ldap]/ensure: 
created
Notice: Finished catalog run in 20.13 seconds
[root@pupmaster manifests]#
__

# cat /etc/hiera.yaml
#### Hiera to search yaml files #####
:backends:
     - yaml

:hierarchy:
#     - "%{operatingsystem}"
     - "%{osfamily}"
     - common
     - defaults
:yaml:
    :datadir: /var/lib/hiera/
__
# cd /var/lib/hiera/
# ls
common.yaml  defaults.yaml  RedHat.yaml
--------------------------------------------
#cat RedHat.yaml
permitt_root_login: 'yes'
ssh_service: 'sshd'
ssh_packages:
    - 'openssh-ldap'
    - 'openssh'
    - 'openssh-clients'
    - 'openssh-server'
__
# cat common.yaml
permit_root_login: 'no'
-----
# cat defaults.yaml
environment: production
-------------------

My ssh package instal module:
# cat sshclient.pp
class openssh::sshclient {
        $ssh_packages=hiera('ssh_packages')
        $permit_root_login=hiera('permitt_root_login')
         $sshservice=hiera('ssh_service')

        package {$ssh_packages:
                ensure => 'present',
                before => File['/etc/ssh/sshd_config'],
                }

        file {'/etc/ssh/sshd_config':
                ensure => present,
                owner => 'root',
                group => 'root',
                mode => '0600',
                content => template('openssh/sshd_config.erb'),
                }

        service {$sshservice:
                subscribe => File['/etc/ssh/sshd_config'],
                ensure => running,
                enable => true,
                hasstatus => true,
                hasrestart => true,
                }
}
____________________________________________________

On puppetclient/agent node:
---------------------------

[root@pupclient2
....
.....
Error: Could not retrieve catalog from remote server: Error 400 on SERVER: 
Evaluation Error: Error while evaluating a Function Call, Could not find 
data item ssh_packages in any Hiera data file and no default supplied at 
/etc/puppetlabs/puppet/environments/production/modules/openssh/manifests/sshclient.pp:2:16
 
on node pupclient2.
Error: Could not retrieve catalog; skipping run
[root@pupclient2
-----

Is there anything I am missing here /any thing I need to enable to make 
puppet agent to work fine with hiera.

Thanks,

On Friday, June 19, 2015 at 2:13:30 PM UTC+5:30, Helen Paterson wrote:
>
> Hi,
>
> I'm trying to set-up puppet environment so that our ymal files can 
> usernames and passwords for Production and test ( dq), modules will be the 
> same. I have run through the documentation but am getting the following 
> error:
>
> client error
>
> Error: Could not retrieve catalog from remote server: Error 400 on SERVER: 
> Could
> not find data item classes in any Hiera data file and no default supplied 
> at /e
> tc/puppet/environments/dq/manifests/windows-servers.pp:54 on node 
> hp-test2008r2.
>
>
> debug from master
> Cannot find datafile /var/lib/hiera/
>
>
> I don't understand why puppet is looking in  /var/lib/hiera/.  before 
> setting up environments hiera was working and looking at 
> /etc/puppethiera.yaml but default
>
>
> hiera.yaml 
> :datadir: '/etc/puppet/environments/%{::environment}/hieradata'
>
>
>
>
>

-- 
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/a26af05d-8078-45b7-9d60-24f69e7e6af3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to