Using Hash in define

205 views
Skip to first unread message

Jean Baptiste Favre

unread,
Mar 12, 2012, 7:26:09 AM3/12/12
to puppet...@googlegroups.com
Hello,
I want to pass a hash as parameters for a define

$hash = { name => 'aname', key1 => 'akey', key2 => 'anotherkey' }
mydefine { 'define': hash => $hash }


define mydefine ( $hash ) {
notice("Hash is as follow: name is ${hash[name]}, key1 is
${hash[key1]}, key2 is ${hash[key2]}")
}

When running it , always got an error message:
Error 400 on SERVER: hash is not an hash or array when accessing it with
name.

What I'm doing wrong ?

Regards,
JB

Jean Baptiste Favre

unread,
Mar 12, 2012, 7:32:28 AM3/12/12
to puppet...@googlegroups.com
Answer to myself: always double check for misspelling variable names...

Sorry for noise,
JB

Reply all
Reply to author
Forward
0 new messages