Issue #1738 has been reported by tek-ops.

----------------------------------------
Bug #1738: Array's broken outside of modules manifests
http://projects.reductivelabs.com/issues/show/1738

Author: tek-ops
Status: Unreviewed
Priority: Normal
Assigned to: 
Category: 
Target version: 
Complexity: Unknown
Affected version: 0.24.5
Keywords: 


It appears that variable arrays only work if the array is declared in the 
manifest of the modules using them.  The elements of the array are concatenated 
into a single string.  This prevents templates from successfully looping over 
the array.

For an examples:
/etc/puppet/manifests/nodes.pp
--------------------------------------------------------------------------------
node "test1" {
    $nameservers = ["192.168.0.2", "192.168.0.3"]
    $domain         = "nfs.example.com"

}

node "test2" {
    $nameservers = ["10.0.0.2", "10.0.0.3"]
    $domain         = "prv.example.com"
}

--------------------------------------------------------------------------------

/etc/puppet/modules/resolv/templates/resolv.conf.erb
--------------------------------------------------------------------------------
search <%= domain %>

<% nameservers.each do |server| %>
nameserver <%= server %>
<% end %>
--------------------------------------------------------------------------------

Results for node "test1"
--------------------------------------------------------------------------------
search nfs.example.com

nameserver 192.168.0.2192.168.0.3
--------------------------------------------------------------------------------

Results for node "test2"
--------------------------------------------------------------------------------
search prv.example.com

nameserver 10.0.0.210.0.0.3
--------------------------------------------------------------------------------

So essentially, if the array is declared in the nodes themselves, then
the elements are concatenated.   Which is more odd since if an array
is declared in /etc/puppet/modules/resolv/init.pp then is does work 


----------------------------------------
You have received this notification because you have either subscribed to it, 
or are involved in it.
To change your notification preferences, please click here: 
http://reductivelabs.com/redmine/my/account

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Puppet Bugs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/puppet-bugs?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to