On Monday, April 21, 2014 6:27:21 PM UTC-5, Ritesh Nanda wrote: > > Hello , > > I have a custom facts which returns the block devices based on some > condition in an array. > > facter | grep arraydev > arraydev => ["sdb", "sdc"] > > Now i want to use this array in defined type so that a exec resource can > run as no. of times elements in the array. > > vi modules/test/manifest/exeecho.pp > > define test::exeecho() { > exec {"echo_${name}": > command => "echo hello >> /tmp/foo23", > path => ['/bin'], > } > } > > > vi modules/test/manifest/init.pp > > class test { > test::exeecho{$::arraydev:} > } > > > But puppet agent -t run gives a error. > > Error: Could not retrieve catalog from remote server: Error 400 on SERVER: > Puppet::Parser::AST::Resource failed with error ArgumentError: Invalid > resource type exec at > /etc/puppetlabs/puppet/modules/test/manifests/exeecho.pp:5 on node > pzxdcc0002.cdbt.pldc.kp.org > Warning: Not using cache on failed catalog > Error: Could not retrieve catalog; skipping run > > Please tell me if i am doing something wrong. > >
Your manifests look fine to me, but the error message you report is surpassingly strange. The exec resource type is distributed with Puppet itself, so the parser is exceedingly confused when it claims not to recognize it. I am inclined to suspect that the Puppet installation on your master is borked. Perhaps you have two different versions installed at the same time, such as maybe one from an RPM and another from a gem? John -- 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/f6f7e82c-a462-4ba8-9aee-6d4816509129%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.