Quantcast
Channel: Ask Puppet: Puppet DevOps Q&A Community - RSS feed
Viewing all articles
Browse latest Browse all 6104

Data type is valid hash but create_resources function refuses to accept it.

$
0
0
Thanks in advance for your time and attention.> ENV Details:>> Puppet Master Enterprise 3.2.3>> Puppet Agent Enterprise 3.2.3>> OS: SLES 11SP4 (Suse Linux Enterprise> Server 11 Service Pack 4) I have a site.pp that has the following entries $htdocs_r22_dump_data= { 'dump_value' => '1' } $htdocs_r22_pass_data= { 'pass_value' => '2' } $htdocs_r8_dump_data= { 'dump_value' => '1' } $htdocs_r8_pass_data= { 'pass_value' => '2' } $htdocs_r22_hash = { 'mount' => '/opt/adp/htdocs_r22', 'ensure' => 'present', 'device' => 'portalfs.homeprod.whc:/paas_portal_htdocs', 'options' => 'rw,bg,hard,nointr,tcp,vers=3,rsize=65535,wsize=65535,timeo=600,actimeo=0', } $htdocs_r8_hash = { 'mount' => '/opt/adp/htdocs_r8', 'ensure' => 'mounted', 'device' => 'portalfs.homeprod.whc:/paas_portal_htdocs', 'options' => 'rw,bg,hard,nointr,tcp,vers=3,rsize=65535,wsize=65535,timeo=600,actimeo=0',} $pmm22=inline_template("<%= $htdocs_r22_hash.merge!($htdocs_r22_pass_data).merge!($htdocs_r22_dump_data) %>") $pmm8=inline_template("<%= $htdocs_r8_hash.merge!($htdocs_r8_pass_data).merge!($htdocs_r8_dump_data) %>") $pmm=inline_template("<%= { 'htdocs_r22' => $pmm22, 'htdocs_r8' => $pmm8 } %>") $data_type=inline_template("<%= $pmm.class %>") $paas_mounts_migr=$pmm node /.*es.ad.adp.com/ { include mount::migration } One of the module called mount migration has the following notify { $paas_mounts_migr: } $data_type_new=inline_template("<%= $paas_mounts_migr.class %>") notify { "coolest": message => "$data_type_new" } create_resources(mount_migration,$paas_mounts_migr) } .............................................................................. When I run virtual@cdl-pid-b1-01:~> sudo puppet agent --test --environment reconfigure_puppetagent_2_diff_master I see the following error > Error: Could not retrieve catalog from> remote server: Error 400 on SERVER:> create_resources(): second argument> must be a hash at> /etc/puppetlabs/puppet/environments/reconfigure_puppetagent_2_diff_master/modules/mount/manifests/migration.pp:54> on node cdl-pid-b1-01.es.ad.adp.com Warning: Not using cache on failed catalog Error: Could not retrieve catalog; skipping run However if I comment out the create_resources line and run I see this. ---------- Notice: Hash -------> Data type is a hash. Notice: /Stage[main]/Mount::Migration/Notify[coolest]/message: defined 'message' as 'Hash' -----> data type is hash Notice: {"htdocs_r22"=>{"mount"=>"/opt/adp/htdocs_r22", "ensure"=>"present", "device"=>"portalfs.homeprod.whc:/paas_portal_htdocs", "options"=>"rw,bg,hard,nointr,tcp,vers=3,rsize=65535,wsize=65535,timeo=600,actimeo=0", "pass_value"=>"2", "dump_value"=>"1"}, "htdocs_r8"=>{"mount"=>"/opt/adp/htdocs_r8", "ensure"=>"mounted", "device"=>"portalfs.homeprod.whc:/paas_portal_htdocs", "options"=>"rw,bg,hard,nointr,tcp,vers=3,rsize=65535,wsize=65535,timeo=600,actimeo=0", "pass_value"=>"2", "dump_value"=>"1"}} Notice: /Stage[main]/Mount::Migration/Notify[{"htdocs_r22"=>{"mount"=>"/opt/adp/htdocs_r22", "ensure"=>"present", "device"=>"portalfs.homeprod.whc:/paas_portal_htdocs", "options"=>"rw,bg,hard,nointr,tcp,vers=3,rsize=65535,wsize=65535,timeo=600,actimeo=0", "pass_value"=>"2", "dump_value"=>"1"}, "htdocs_r8"=>{"mount"=>"/opt/adp/htdocs_r8", "ensure"=>"mounted", "device"=>"portalfs.homeprod.whc:/paas_portal_htdocs", "options"=>"rw,bg,hard,nointr,tcp,vers=3,rsize=65535,wsize=65535,timeo=600,actimeo=0", "pass_value"=>"2", "dump_value"=>"1"}}]/message: defined 'message' as '{"htdocs_r22"=>{"mount"=>"/opt/adp/htdocs_r22", "ensure"=>"present", "device"=>"portalfs.homeprod.whc:/paas_portal_htdocs", "options"=>"rw,bg,hard,nointr,tcp,vers=3,rsize=65535,wsize=65535,timeo=600,actimeo=0", "pass_value"=>"2", "dump_value"=>"1"}, "htdocs_r8"=>{"mount"=>"/opt/adp/htdocs_r8", "ensure"=>"mounted", "device"=>"portalfs.homeprod.whc:/paas_portal_htdocs", "options"=>"rw,bg,hard,nointr,tcp,vers=3,rsize=65535,wsize=65535,timeo=600,actimeo=0", "pass_value"=>"2", "dump_value"=>"1"}}' Notice: Hash ------> data type is a hash Notice: /Stage[main]/Main/Notify[Hash]/message: defined 'message' as 'Hash' ----------> data type is hash Notice: Finished catalog run in 3.25 seconds ---------- So the question is Even though puppet puts the data type is Hash it is NOT being considered as Hash. Any idea whats could be the issue. -Narahari

Viewing all articles
Browse latest Browse all 6104

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>