Re: [Puppet Users] Array of variables

23 views
Skip to first unread message
Message has been deleted

Louis Coilliot

unread,
Feb 11, 2014, 5:09:27 AM2/11/14
to puppet...@googlegroups.com
Put your array in a example.com.yaml file.




2014-02-11 10:51 GMT+01:00 Luis León <ayo...@gmail.com>:
I have on my node definition the following code:

node 'example.com' {

  class {'push':
                $roles  =>  { rol_as => "false",
                                  rol_ws => "true",
                                  ... },
             }

And I need to pass these variables to a class through:

  class push ($roles)
  ...
  if $roles[rol_ws]=='true' {
  ...
  }

}
 
It works defining the hash inside the class but on the node definition don't work, any suggestion?

Thanks!!






--
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...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/11e8399f-0891-45fa-9a1e-3f079f73185b%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Felix Frank

unread,
Feb 11, 2014, 5:14:04 AM2/11/14
to puppet...@googlegroups.com
Hi,

On 02/11/2014 10:51 AM, Luis León wrote:
> class {'push':
> $roles => { rol_as => "false",
> rol_ws => "true",
> ... },
> }

Your syntax is slightly off:

class { 'push': roles => { ... } }

That is, you must not add the $ sign in the class declaration.

HTH,
Felix
Reply all
Reply to author
Forward
0 new messages