Issue solved. It was something simple, the double quotation was
missing when declaring the File.
An.

On Dec 29, 1:58 pm, An <mizuki0...@gmail.com> wrote:
> Hi,
>
> I'm a newbie to Puppet so please bare with me if I made silly mistakes
> or question something really simple.
>
> I was trying to intergrate Puppet with Nagios and I was customizing
> David S's manifests/init.pp - extra_host define. I basically added one
> more variable ($host_template) in the purpose of creating ${name}
> _host.cfg file based on preferred host template.
>
> define extra_host($ip = $fqdn, $short_alias = $fqdn, $parent = "none",
> $host_template="none") {
>     $nagios_parent = $parent
>     $nagios_host_tempalte = $host_template
>        file{
>           "$nagios_cfgdir/${name}_host.cfg":
>                   ensure => present,
>                   mode => 644, owner => root, group => root,
>        }
>
>        case $host_template {
>              'test': { File[$nagios_cfgdir/${name}_host.cfg] { content
> => template ( "nagios_ds/host_test.erb" )} }
>              default: { File[$nagios_cfgdir/${name}_host.cfg]
> { content => template ( "nagios_ds/host.erb" )} }
>        }
>
> }
>
> Then I tried to compile it, puppet complains Syntax error at
> '/';expected ']' at the case line, but I don't see what was wrong in
> those line. If I comment the case statement out, it went through fine.
> Can someone point me what I did wrong?
>
> An

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To post to this group, send email to puppet-us...@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.

Reply via email to