Hi Rob,

My bad..Issue with hiera datadir location ownership and permission.
changed to puppet from root ownership. Hiera looks up working fine for
puppet agent now..

Thanks

On Thu, Jul 9, 2015 at 8:08 AM, PAN dheepak kumar <[email protected]>
wrote:

> Hi Rob.
> Thanks for the reply.
>
> [root@pupclient2]# facter osfamily
> RedHat
> [root@pupclient2]# facter operatingsystem
> OracleLinux
> [root@pupclient2]#
> ----
> [root@pupmaster]# facter osfamily
> RedHat
> [root@pupmaster]# facter operatingsystem
> OracleLinux
> [root@pupmaster]#
>
> Both Master and client are running same OS and same version.
>
> [root@pupclient2]# cat /etc/redhat-release
> Red Hat Enterprise Linux Server release 6.5 (Santiago)
> [root@pupclient2]#
> ---
> [root@pupmaster]# cat /etc/redhat-release
> Red Hat Enterprise Linux Server release 6.5 (Santiago)
> [root@pupmaster]
> ---
>
> Thanks
>
> On Thu, Jul 9, 2015 at 12:19 AM, Rob Reynolds <[email protected]> wrote:
>
>>
>>
>> On Wed, Jul 8, 2015 at 3:07 AM, PAN <[email protected]> wrote:
>>
>>> 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.
>>>
>>
>>
>> What do you get when you run facter operatingsystem and facter osfamily
>> on pupclient2?
>>
>>
>>
>>>
>>> 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 [email protected].
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/puppet-users/a26af05d-8078-45b7-9d60-24f69e7e6af3%40googlegroups.com
>>> <https://groups.google.com/d/msgid/puppet-users/a26af05d-8078-45b7-9d60-24f69e7e6af3%40googlegroups.com?utm_medium=email&utm_source=footer>
>>> .
>>>
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>
>>
>> --
>> Rob Reynolds
>> Developer, Puppet Labs
>>
>> *PuppetConf 2015 <http://2015.puppetconf.com/> is coming to Portland,
>> Oregon! Join us October 5-9.*
>> *Register now to take advantage of the Early Adopter discount
>> <https://www.eventbrite.com/e/puppetconf-2015-october-5-9-tickets-13115894995?discount=EarlyAdopter>
>>  *
>> *—**save $349!*
>>
>> --
>> 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/CAMJiBK7WB%2B%2Bps3KcfHXEd%2BxWBsJB6fLdWnN%2Bhx7kfkBgKcw%3DCQ%40mail.gmail.com
>> <https://groups.google.com/d/msgid/puppet-users/CAMJiBK7WB%2B%2Bps3KcfHXEd%2BxWBsJB6fLdWnN%2Bhx7kfkBgKcw%3DCQ%40mail.gmail.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/CAFG-qHT8swwGK2cNoKfyqFQxuYL3KJs66fMPJ%2BinLg3HEyb2bg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to