Jira (PUP-6950) scope.function_getparam does not work in ERB templates (future parser)

2016-12-02 Thread Henrik Lindberg (JIRA)
Title: Message Title
 
 
 
 
 
 
 
 
 
 
  
 
 Henrik Lindberg commented on  PUP-6950 
 
 
 
 
 
 
 
 
 
 

 
 
 
 
 
 
 
  Re: scope.function_getparam does not work in ERB templates (future parser)  
 
 
 
 
 
 
 
 
 
 
Do look at the blog post I linked - it explains exactly how the queuing and lazy evaluation of "user defined resource type" kind of resources work. 
It is a very brittle design to rely on resources having been evaluated in a particular order. Classes on the other hand are stable, and they are evaluated directly, together with the classes they include in turn. 
You can certainly loop in your ERB. If you have the information in a variable in the class that holds the input of the 'severname' => 'ip' mapping, use that instead of trying to look that information up from the created resources. Then things will happen in the natural order. 
 
 
 
 
 
 
 
 
 
 
 
 

 
 Add Comment 
 
 
 
 
 
 
 
 
 
 

 
 
 
 
 
 
 
 
 
 

 This message was sent by Atlassian JIRA (v6.4.14#64029-sha1:ae256fe) 
 
 
 
 
  
 
 
 
 
 
 
 
 
   





-- 
You received this message because you are subscribed to the Google Groups "Puppet Bugs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-bugs+unsubscr...@googlegroups.com.
To post to this group, send email to puppet-bugs@googlegroups.com.
Visit this group at https://groups.google.com/group/puppet-bugs.
For more options, visit https://groups.google.com/d/optout.


Jira (PUP-6950) scope.function_getparam does not work in ERB templates (future parser)

2016-12-02 Thread Rowan Ruseler (JIRA)
Title: Message Title
 
 
 
 
 
 
 
 
 
 
  
 
 Rowan Ruseler commented on  PUP-6950 
 
 
 
 
 
 
 
 
 
 

 
 
 
 
 
 
 
  Re: scope.function_getparam does not work in ERB templates (future parser)  
 
 
 
 
 
 
 
 
 
 
Henrik Lindberg, thanks once again. 
What I notice is when I create a scope.lookupvar('foo::server'), it does load the 'server_name'. Kinda confused then why the scope.function_ does not. Or it does, but the servers::information is not yet been evaluated? 
So I assume that this is what you wrote about 'order of evaluation'.  
do as little as possible class servers::information has more server(s) then one, so I am unable to do that (well, my knowledge stops here - I can not find any documentation on how to do that). Can I create something like $server_name = "$ {server_id} 
" within the ERB? That it looks up what specific 'server_id' - foo/foo2/etc and gets the correct value? 
 
 
 
 
 
 
  server { 'foo': 
 
 
 
 
  
 
 
 
 
ip_address => "127.0.0.1", 
 
 
 
 
  
 
 
 
 
  } 
 
 
 
 
   
 
 
 
 
  server { 'foo2': 
 
 
 
 
  
 
 
 
 
  

Jira (PUP-6950) scope.function_getparam does not work in ERB templates (future parser)

2016-12-01 Thread Henrik Lindberg (JIRA)
Title: Message Title
 
 
 
 
 
 
 
 
 
 
  
 
 Henrik Lindberg commented on  PUP-6950 
 
 
 
 
 
 
 
 
 
 

 
 
 
 
 
 
 
  Re: scope.function_getparam does not work in ERB templates (future parser)  
 
 
 
 
 
 
 
 
 
 
That approach is ok as long as they refer to the variables of classes in that module. Referring to the attributes of resources that it creates means you are open to issues caused by the order of evaluation. What I think you should do if you want to do as little as possible is to simply look up qualified variables in your ERB. 
In your example, when you are evaluating the line: 
 
 
 
 
 
 
  $server = Servers::Information::Server[$server_name]
 
 
 
 
 
 
 
The resource 'Servers::Information::Server['foo']' has not yet been evaluated. It will not be evaluated until the class foo has finished its work (and those that included it). Read more here: http://puppet-on-the-edge.blogspot.com.mt/2014/04/getting-your-puppet-ducks-in-row.html 
In 4.x you have many other options for managing your data that are better. 
 
 
 
 
 
 
 
 
 
 
 
 

 
 Add Comment 
 
 
 
 
 
 
 
 
 
 

 
 
 
 
 
 
 
 
 
 

 This message was sent by Atlassian JIRA (v6.4.14#64029-sha1:ae256fe) 
 
 
 
 
  
 
 
 
 
 
 
 
 
   





-- 
You received this message because you are subscribed to the Google Groups "Puppet Bugs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-bugs+unsubscr...@googlegroups.com.
To post to this group, send email to puppet-bugs@googlegroups.com.
Visit this group at 

Jira (PUP-6950) scope.function_getparam does not work in ERB templates (future parser)

2016-12-01 Thread Rowan Ruseler (JIRA)
Title: Message Title
 
 
 
 
 
 
 
 
 
 
  
 
 Rowan Ruseler commented on  PUP-6950 
 
 
 
 
 
 
 
 
 
 

 
 
 
 
 
 
 
  Re: scope.function_getparam does not work in ERB templates (future parser)  
 
 
 
 
 
 
 
 
 
 
Henrik Lindberg, thanks for the reply. 
How it works with parser future disabled is that it takes the specific information from another module where I've information stored. Multiple modules cherry pick from this module for the information they need. It makes it easy to manage the server overview of database ips, fingerprints, keys, etc. 
It is kinda like this: init.pp 
 
 
 
 
 
 
class foo { 
 
 
 
 
  include servers::information 
 
 
 
 
  
 
 
 
 
  $server_name = "${server_id}" 
 
 
 
 
  $server= Servers::Information::Server[$server_name] 
 
 
 
 
}
 
 
 
 
 
 
 
servers::information, 
 
 
 
 
 
 
class servers::information { 
 
 
 
 
  define server( 
 
 

Jira (PUP-6950) scope.function_getparam does not work in ERB templates (future parser)

2016-11-30 Thread Josh Cooper (JIRA)
Title: Message Title
 
 
 
 
 
 
 
 
 
 
  
 
 Josh Cooper updated an issue 
 
 
 
 
 
 
 
 
 
 

 
 
 
 
 
 
 
 Puppet /  PUP-6950 
 
 
 
  scope.function_getparam does not work in ERB templates (future parser)  
 
 
 
 
 
 
 
 
 

Change By:
 
 Josh Cooper 
 
 
 

Team:
 
 Puppet Developer Support 
 
 
 
 
 
 
 
 
 
 
 
 

 
 Add Comment 
 
 
 
 
 
 
 
 
 
 

 
 
 
 
 
 
 
 
 
 

 This message was sent by Atlassian JIRA (v6.4.14#64029-sha1:ae256fe) 
 
 
 
 
  
 
 
 
 
 
 
 
 
   





-- 
You received this message because you are subscribed to the Google Groups "Puppet Bugs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-bugs+unsubscr...@googlegroups.com.
To post to this group, send email to puppet-bugs@googlegroups.com.
Visit this group at https://groups.google.com/group/puppet-bugs.
For more options, visit https://groups.google.com/d/optout.


Jira (PUP-6950) scope.function_getparam does not work in ERB templates (future parser)

2016-11-30 Thread Henrik Lindberg (JIRA)
Title: Message Title
 
 
 
 
 
 
 
 
 
 
  
 
 Henrik Lindberg assigned an issue to Rowan Ruseler 
 
 
 
 
 
 
 
 
 
 

 
 
 
 
 
 
 
 Puppet /  PUP-6950 
 
 
 
  scope.function_getparam does not work in ERB templates (future parser)  
 
 
 
 
 
 
 
 
 

Change By:
 
 Henrik Lindberg 
 
 
 

Assignee:
 
 Rowan Ruseler 
 
 
 
 
 
 
 
 
 
 
 
 

 
 Add Comment 
 
 
 
 
 
 
 
 
 
 

 
 
 
 
 
 
 
 
 
 

 This message was sent by Atlassian JIRA (v6.4.14#64029-sha1:ae256fe) 
 
 
 
 
  
 
 
 
 
 
 
 
 
   





-- 
You received this message because you are subscribed to the Google Groups "Puppet Bugs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-bugs+unsubscr...@googlegroups.com.
To post to this group, send email to puppet-bugs@googlegroups.com.
Visit this group at https://groups.google.com/group/puppet-bugs.
For more options, visit https://groups.google.com/d/optout.


Jira (PUP-6950) scope.function_getparam does not work in ERB templates (future parser)

2016-11-30 Thread Henrik Lindberg (JIRA)
Title: Message Title
 
 
 
 
 
 
 
 
 
 
  
 
 Henrik Lindberg commented on  PUP-6950 
 
 
 
 
 
 
 
 
 
 

 
 
 
 
 
 
 
  Re: scope.function_getparam does not work in ERB templates (future parser)  
 
 
 
 
 
 
 
 
 
 
Impossible to tell what is going wrong from the small sample. My guess it is another problem causing this. The order of evaluation is perhaps not the same and I suspect that the getparam function digs out a parameter from a particular resource.  
If the parameter is a class param, then it should be looked up as a variable using its fully qualified name. If it is not a class parameter, then the code is just a bad idea of relying on some value from far away that in turn depends on the order of evaluation. 
What is the "getparam" function? 
 
 
 
 
 
 
 
 
 
 
 
 

 
 Add Comment 
 
 
 
 
 
 
 
 
 
 

 
 
 
 
 
 
 
 
 
 

 This message was sent by Atlassian JIRA (v6.4.14#64029-sha1:ae256fe) 
 
 
 
 
  
 
 
 
 
 
 
 
 
   





-- 
You received this message because you are subscribed to the Google Groups "Puppet Bugs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-bugs+unsubscr...@googlegroups.com.
To post to this group, send email to puppet-bugs@googlegroups.com.
Visit this group at https://groups.google.com/group/puppet-bugs.
For more options, visit https://groups.google.com/d/optout.


Jira (PUP-6950) scope.function_getparam does not work in ERB templates (future parser)

2016-11-30 Thread Rowan Ruseler (JIRA)
Title: Message Title
 
 
 
 
 
 
 
 
 
 
  
 
 Rowan Ruseler created an issue 
 
 
 
 
 
 
 
 
 
 

 
 
 
 
 
 
 
 Puppet /  PUP-6950 
 
 
 
  scope.function_getparam does not work in ERB templates (future parser)  
 
 
 
 
 
 
 
 
 

Issue Type:
 
  Bug 
 
 
 

Affects Versions:
 

 PUP 3.8.1 
 
 
 

Assignee:
 

 Unassigned 
 
 
 

Created:
 

 2016/11/30 7:02 AM 
 
 
 

Priority:
 
  Normal 
 
 
 

Reporter:
 
 Rowan Ruseler 
 
 
 
 
 
 
 
 
 
 
Code example template.erb; 
 
 
 
 
 
 
<%= scope.function_getparam( [@server,'ip_address'] ) %>
 
 
 
 
 
 
 
Within Puppet 3.8, without `parser = future` this functions. With, it does not provide an error. I receive an empty strings in the result instead of expected value. 
I found, 

PUP-4328
 - and I assume it is kinda resembling the same issue.