Hello Toni , John

Thanks for your help.

Doing validate array gives a  

 Error 400 on SERVER: "" is not an Array.  It looks to be a String

I made it working using  $arrayvar = split($::arraydev, '[,]') then calling 
 test::exeecho{$arrayvar:} , in this way it works and its process the array 
. 

now the init.pp looks like 

class test {
$arrayvar = split($::arraydev, '[,]')
test::exeecho{$arrayvar:}
}

Doing validate array tells me it is string not an array , Is this the right 
way to do it. Or there can be a better way to do it.

Regards,
Ritesh Nanda


On Monday, 21 April 2014 17:27:21 UTC-6, 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.
>
> Regards,
> Ritesh Nanda
>
>
>
>
>
>
>

-- 
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/5f7536a9-a42e-4f1d-b1fe-1b4bda324f51%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to