You could likely use iteration in the future parser or recursion to build
up the string, but what sits in my mind as the path of least resistance is
inline templating (c.f.
https://docs.puppetlabs.com/references/latest/function.html#inlinetemplate).

I ran a quick test along these lines and it appeared to produce appropriate
output:

  $search = {
    'cust0' => 'a41mgt.local all-for-one.local',
    'cust1' => 'A4T.local',
    'cust2' => 'a4y.remote',
  }

  notify { "ILT Search: ${search}": }

  $string = inline_template("<%= @search.values.join(' ') %>")

  notify { "ILT String: ${string}": }

  Notice: ILT Search: cust2a4y.remotecust1A4T.localcust0a41mgt.local
all-for-one.local
  Notice: ILT String: a4y.remote A4T.local a41mgt.local all-for-one.local

This can definitely be improved upon, but it seems to do the trick.


On Fri, Jan 9, 2015 at 8:09 AM, Michael Wörz <michael.wo...@gmail.com>
wrote:

> Hello,
>
> given the following datastructure i want to create a resolv.conf file
>
> dns:
>
>     nameservers:
>          '3': 10.200.1.230
>          '4': 10.200.1.231
>
>           .......
>     search:
>          cust0: a41mgt.local all-for-one.local
>          cust1: A4T.local
>
>          ......
>
>
> for the nameserver list it is easy to itaerate over the list calling a 
> defined type with a concat resource.
>
>
> the search list gives me  headache because i need to concatinate a string 
> from it.
>
>               a41mgt.local all-for-one.local A4T.local ...
>
>
> any ideas ?
>
>
> Thanks
>
>  --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/puppet-users/2b2a3b34-1120-4d61-bfd6-caae6f6b0303%40googlegroups.com
> <https://groups.google.com/d/msgid/puppet-users/2b2a3b34-1120-4d61-bfd6-caae6f6b0303%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/CALGSqjLCxEBsQbF9xZPfJvA8tUUFvBFvh0Ajp_PQ7%3DJ1S-UKwg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to