Re: [Puppet Users] Unable to access hash elements directly from templates

2012-04-12 Thread Josh
On Wednesday, 11 April 2012 17:14:10 UTC+1, Gary Larizza wrote: Don't use the $ for variables in Templates - Puppet variables and arrays are accessed as local variables/arrays in templates. So try this: TEST: %= myhash[key][subkey1] % Ah, I did try that before. I get the error: err:

Re: [Puppet Users] Unable to access hash elements directly from templates

2012-04-12 Thread Josh
Sorry, that should be: err: Could not retrieve catalog from remote server: Error 400 on SERVER: Failed to parse template mymodule/test.erb: Could not find value for 'key' at /etc/puppet/modules/mymodule/manifests/init.pp:7 on node pc01.domain.com (i.e. it errors on the content = ... line)

Re: [Puppet Users] Unable to access hash elements directly from templates

2012-04-12 Thread Josh
Eventually I worked this out (nothing like trying every possible combination eh), solution was to remove the $ at the start as you said and also quote the keys in single quotes like so: TEST: %= myhash['key']['subkey1'] % Thanks again for your help Josh -- You received this message because

[Puppet Users] Unable to access hash elements directly from templates

2012-04-11 Thread Josh
I am using puppet version 6.2 (the one that comes with squeeze) in case it makes a difference. I am new to puppet and am having a problem getting access to the elements of a hash in my erb templates and no matter what I google for I cannot seem to find out what I am doing wrong. I have

Re: [Puppet Users] Unable to access hash elements directly from templates

2012-04-11 Thread Gary Larizza
Hey Josh, Don't use the $ for variables in Templates - Puppet variables and arrays are accessed as local variables/arrays in templates. So try this: TEST: %= myhash[key][subkey1] % On Wed, Apr 11, 2012 at 9:04 AM, Josh j...@chickenmonkey.co.uk wrote: I am using puppet version 6.2 (the one