If I run this command, which use a local hiera_config, then it will work:
[root@shn-ops2 etc]# puppet apply -e 'include cds_master' --hiera_config=/etc/hiera.yaml.bak
Warning: Variable access via 'operatingsystem' is deprecated. Use '@operatingsystem' instead. template[/etc/puppet/modules/cds_master/template/auto.direct.erb]:1
(at /usr/lib/ruby/site_ruby/1.8/puppet/parser/templatewrapper.rb:77:in `method_missing')
Notice: Compiled catalog for shn-ops2.cisco.com in environment production in 0.20 seconds
Notice: /Stage[main]/Cds_master::Cdss/File[/etc/auto.master]/content: content changed '{md5}6165fb9b5003e3bdb2c0b99761aded75' to '{md5}f6772d737c6e6045338b913e6c601b8d'
Notice: the cds_master is shn-ops2
Notice: /Stage[main]/Cds_master::Cdss/Notify[display]/message: defined 'message' as 'the cds_master is shn-ops2'
Notice: /Stage[main]/Cds_master::Cdss/Cds_master::Send_mail::Message[AUTO.MASTER]/Exec[AUTO.MASTER]: Triggered 'refresh' from 1 events
Notice: /Stage[main]/Cds_master::Cdss/Exec[mount_check]/returns: executed successfully
Notice: /Stage[main]/Cds_master::Cdss/Cds_master::Send_mail::Message[MOUNT_CHECK]/Exec[MOUNT_CHECK]: Triggered 'refresh' from 1 events
Notice: Finished catalog run in 0.42 seconds
[root@shn-ops2 etc]#
Means, the test is passed locally on the client side.
but if I run as below,then get error:
[root@shn-ops3 ~]# puppet agent -t
Warning: Local environment: "production" doesn't match server specified node environment "ecs_development", switching agent to "ecs_development".
Info: Retrieving pluginfacts
Info: Retrieving plugin
Info: Loading facts
Error: Could not retrieve catalog from remote server: Error 400 on SERVER: undefined method `empty?' for nil:NilClass at /cpos-shared/cpos-env/ecs_development/modules/cds_master/manifests/cdss.pp:4 on node shn-ops3.cisco.com
Warning: Not using cache on failed catalog
Error: Could not retrieve catalog; skipping run
[root@shn-ops3 ~]#
the code is:
class cds_master::cdss{
$cds_master_srv = hiera('cds_master::cds_master_srv')
$cds_dev_srv = hiera('cds_master::cds_dev_srv')
......
and the hiera data is simply:
cds_master::cds_master_srv: 'fud-lnx'
cds_master::cds_dev_srv: 'shn-ops2'
I really don't know what happened. so really need some help here.
Thanks!
↧
Error: Could not retrieve catalog from remote server: Error 400 on SERVER: undefined method `empty?'
↧