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,