Sorry. wrong function:

content => $set.join("\n")

hth,
martin


> On 29. Feb 2020, at 15:56, Dan Crisp <djc7...@gmail.com> wrote:
> 
> Thanks for the respone Martin.  Unfortunately that made no difference.  Still 
> only end up with one line.
> 
> Thanks,
> Dan.
> 
> On Saturday, February 29, 2020 at 2:44:38 PM UTC, Martin Alfke wrote:
> AFAIK content expects a string. 
> Maybe you can try 
> 
> content => $set.flatten 
> 
> hth, 
> martin 
> 
> 
> > On 29. Feb 2020, at 14:42, Dan Crisp <djc...@gmail.com> wrote: 
> > 
> > Hi, 
> > 
> > Attempting to popualte a file with a hiera array.   
> > 
> > I have the following hiera defined: 
> > 
> > # more common.yaml 
> > vimrc: 
> >   - 'syntax on' 
> >   - 'colo delek' 
> >   - 'set nu' 
> >   - 'set cursorline' 
> >   - 'set history=1000' 
> >   - 'set showmode' 
> >   - 'set showcmd' 
> > 
> > Puppet lookup seems to return what I expect to see: 
> > 
> > # puppet lookup vimrc 
> > --- 
> > - syntax on 
> > - colo delek 
> > - set nu 
> > - set cursorline 
> > - set history=1000 
> > - set showmode 
> > - set showcmd 
> > 
> > Here's how I'm call the hiera array: 
> > 
> > class base::vim { 
> > 
> >   $set = lookup('vimrc', Array[String]) 
> > 
> >   package { 'vim': ensure => installed, } 
> > 
> >   file { '/root/.vimrc': 
> >     owner    => root, 
> >     group    => root, 
> >     mode     => '0644', 
> >     content  => $set, 
> >   } 
> > 
> > } 
> > 
> > However I just end up with the last line of the arrary: 
> > 
> > # more .vimrc 
> > set showcmd 
> > 
> > Any help here would be greatly appreciated. 
> > 
> > Thanks, 
> > Dan. 
> > 
> > -- 
> > 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...@googlegroups.com. 
> > To view this discussion on the web visit 
> > https://groups.google.com/d/msgid/puppet-users/3620a92d-f2d2-43a4-9f92-4d12c3f0c45f%40googlegroups.com.
> >  
> 
> 
> -- 
> 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/d30de2a4-a70b-41df-a9d3-f65001498be7%40googlegroups.com.

-- 
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/BACFAD74-D69C-445E-8244-126020CCA29B%40gmail.com.

Reply via email to