FAQ

On 2013-09-08 17:13, Rafi wrote:

<%- @instance_names.each do | instance_name | -%>
define host {
host_name <%= @instance_name %>
alias <%= @instances[@instance_name]['public_ip'] %>
address <%= @instances[@instance_name]['private_ip'] %>
}
<%- end -%>


I know I can access @instances and @instance_names within the template,
but the template does not appear to find values for the loop variable
@instance_name. Why is this?
Because it should be accessed without the @ since it is not a variable
from Puppet.

Try:

    alias <%= @instances[instance_name]['public_ip'] %>

Regards
- henrik


--
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+unsubscribe@googlegroups.com.
To post to this group, send email to puppet-users@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users.
For more options, visit https://groups.google.com/groups/opt_out.

Search Discussions

Discussion Posts

Previous

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 2 of 2 | next ›
Discussion Overview
grouppuppet-users @
categoriespuppet
postedAug 9, '13 at 9:13p
activeAug 11, '13 at 3:48p
posts2
users2
websitepuppetlabs.com

2 users in discussion

Rafi: 1 post Henrik Lindberg: 1 post

People

Translate

site design / logo © 2022 Grokbase