protest:
  file1:
    logdir: '/tmp/'
    logfile: fred1
    text: 'Alfredo1 was here'
protest:
  file2:
    logdir: '/tmp/'
    logfile: fred2
    text: 'Alfredo2 was here'

This I believe is incorrect.

protest:
  file1:
    logdir: '/tmp/'
    logfile: fred1
    text: 'Alfredo1 was here'
  file2:
    logdir: '/tmp/'
    logfile: fred2
    text: 'Alfredo2 was here'

This will return you a hash, and then you gotta figure out what you you
want to do with the hash.


On Tue, Apr 14, 2015 at 7:55 AM, Alfredo De Luca <[email protected]>
wrote:

>  Hi all.
> It might be a simple question for you.
>
> In hiera I have the followings
>
> protest::logdir: '/tmp/'
> protest::logfile: fred
> protest::text: 'ok ok was here'
>
> and the class is
>
> class protest (
>   $logdir         = $protest::params::logdir,
>   $logfile        = $protest::params::logfile,
>   $text           = $protest::params::text
> ) inherits protest::params {
>
>   $myfile = "$logdir$logfile"
>   file { $myfile:
>         ensure => file,
>         content => inline_template("<%= text %>\n"),
>         }
> }
>
> and all works fine but I am struggling to use the class from hiera like
> below
>
>
> protest:
>   file1:
>     logdir: '/tmp/'
>     logfile: fred1
>     text: 'Alfredo1 was here'
> protest:
>   file2:
>     logdir: '/tmp/'
>     logfile: fred2
>     text: 'Alfredo2 was here'
>
>
> What do I need to modify in the class in order to use it like that?
>
>
>
> --
> Alfredo
>
> --
> 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 [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/puppet-users/CAAWpFTGAdFxy4%3DSdDKJ14hBhiZHuAzehUv%2B2v20sLJopsaJW_Q%40mail.gmail.com
> .
> 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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/CALuoJ67GKZ2-BterPrOxJvdj3iFKVyuNkTQs2P-Uw3tn43FxbA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to