Re: [Puppet Users] Re: qualified variables in templates

2012-07-17 Thread Felix Frank
Hi,

On 07/13/2012 09:46 PM, david boldt wrote:
 what is the incantation that would work for iteration?
 
 scope.lookupvar('::varname').each

this looks all right but

 Produces puppet error:  undefined method `each' for :undefined:Symbol

it seems that the lookup itself fails. Are you certain you've got the
right name, and that the variable is defined in your context?

It may also be more readable to do

myvar = scope.lookupvar('::varname')
myvar.each do ...

HTH,
Felix

-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



[Puppet Users] Re: qualified variables in templates

2012-07-13 Thread david boldt

what is the incantation that would work for iteration?

scope.lookupvar('::varname').each

Produces puppet error:  undefined method `each' for :undefined:Symbol


On Tuesday, September 20, 2011 2:53:35 PM UTC-4, Alessandro Franceschi 
wrote:

 Use something like %= scope.lookupvar('hostname') % 



-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/puppet-users/-/popQN56eqs8J.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



Re: [Puppet Users] Re: qualified variables in templates

2011-09-21 Thread Arnau Bria
Ok.
so template and class share the scope and tehre's no need to qualify its
vars.

Thanks for your replies and for the link.
Cheers,
Arnau

-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



[Puppet Users] Re: qualified variables in templates

2011-09-20 Thread Alessandro Franceschi
Use something like %= scope.lookupvar('hostname') %

On Sep 20, 11:06 am, Arnau Bria arnaub...@pic.es wrote:
 Hi all,

 is there a way for qualifying variables inside a template?
 I've tried :

 Name = %= ${::hostname} %

 but the var gets ${::hostname} value.

 thinking in version 2.8, is it 
 needed?http://docs.puppetlabs.com/guides/scope_and_puppet.htmlsays nothing
 about this...

 TIA,
 Arnau

-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



Re: [Puppet Users] Re: qualified variables in templates

2011-09-20 Thread Adrien Thebo
There's also more documentation on using puppet specific methods in
templates at http://docs.puppetlabs.com/guides/templating.html

On Tue, Sep 20, 2011 at 11:53 AM, Alessandro Franceschi a...@lab42.it wrote:

 Use something like %= scope.lookupvar('hostname') %

 On Sep 20, 11:06 am, Arnau Bria arnaub...@pic.es wrote:
  Hi all,
 
  is there a way for qualifying variables inside a template?
  I've tried :
 
  Name = %= ${::hostname} %
 
  but the var gets ${::hostname} value.
 
  thinking in version 2.8, is it needed?
 http://docs.puppetlabs.com/guides/scope_and_puppet.htmlsays nothing
  about this...
 
  TIA,
  Arnau

 --
 You received this message because you are subscribed to the Google Groups
 Puppet Users group.
 To post to this group, send email to puppet-users@googlegroups.com.
 To unsubscribe from this group, send email to
 puppet-users+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/puppet-users?hl=en.




-- 
Adrien Thebo
Puppet Labs Operations
adr...@puppetlabs.com

-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.