0
votes

I am trying to learn to write puppet modules in a good way, so I've started looking around for tutorials and howto.

I've seen that users suggest writing the main class in the following way, but It's actually failing for me. I am honestly a bit confused how the 2 blocks between brackets are actually connected, and so I might be not seeing an obvious error or real missing comma.

I am running Puppet 3.8 by the way

class icinga2 {
    $version = 'present'
    $enable = true
    $start = true
} {
    class{'icinga2::install': } ->
    class{'icinga2::config': } ~>
    class{'icinga2::service': } ->
    Class["icinga2"]
}

Error: Could not retrieve catalog from remote server: Error 400 on SERVER: Syntax error at '{'; expected '}' at /etc/puppet/modules/icinga2/manifests/init.pp:5

1
I would like to add the fact that the 3 variables were commas separated before and it was complaining of the same problem on each of them - dandan

1 Answers

2
votes

Your problem here is that your parameters must be surrounded by (), not {}. Also, they should be commas separated.

class icinga2 (
    $version = 'present',
    $enable = true,
    $start = true,
) {
    class{'icinga2::install': } ->
    class{'icinga2::config': } ~>
    class{'icinga2::service': } ->
    Class["icinga2"]
}