/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
(no concatenation).

Best Regards,
Michael Schenck




On Nov 7, 4:00 am, Marcin Owsiany <[EMAIL PROTECTED]> wrote:
> On Thu, Nov 06, 2008 at 07:36:51AM -0800, tek-ops wrote:
>
> > for me, that only works if I specify $nameserver in the manifest for
> > my resolv.conf module.  If I specify it in the node (i.e. configuring
> > one node to use different name servers), it concatenates the two
> > nameserver array elements to a single array.
>
> Please show a minimal example of what you do.
>
> --
> Marcin Owsiany <[EMAIL PROTECTED]>              http://marcin.owsiany.pl/
> GnuPG: 1024D/60F41216  FE67 DA2D 0ACA FC5E 3F75  D6F6 3A0D 8AA0 60F4 1216
>
> "Every program in development at MIT expands until it can read mail."
>                                                               -- Unknown
--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to