1

It's a big problem to me, because I'm not familiar with puppet.

ERROR on the puppetmaster:

debug: importing '/etc/puppet/manifests/nodes/group-1.pp'
err: Could not parse for environment production: Syntax error at '{'; expected '}' at /etc/puppet/manifests/nodes/group-1.pp:6

ERROR on the puppet client:

err: Could not retrieve catalog from remote server: Error 400 on SERVER: Could not parse for environment production: Syntax error at '{'; expected '}' at /etc/puppet/manifests/nodes/group-1.pp:6

in group-1.pp:

node 'group1'
{
        include ntp 

        class { 'nagios::host':           #this is line 6
                nodename => $clientcert,
                appname => 'test',
        }   
}

nagios::host in module module/nagios/host.pp code are here:

class nagios::host($nodename, $hostgroup) {


  file { '/usr/lib/nagios/plugins':
    mode    => "755",
    require => Package["nagios-plugins"],
  }

  ...

    @@nagios_service { "${nodename}_check_ssh":
      ensure => present,
      use => 'generic-service',
      host_name => "${nodename}",
      notification_interval => 60,
      flap_detection_enabled => 0,
      service_description => "SSH",
      check_command => "check_ssh",
      target => "/etc/nagios3/services.d/${nodename}.cfg",
    } 
}

and the file module/nagios/init.pp is blank

How could I fix it ?

quanta
  • 50,327
  • 19
  • 152
  • 213

3 Answers3

2

Puppet 0.25 does not support parametrized classes, you must upgrade to puppet > 2.6.

robbyt
  • 1,622
  • 3
  • 14
  • 26
1

That's solved. The puppet master version is 0.25, defautl on ubuntu 10.04 LTS. I've upgrade it to 2.7.14 , and it runs ok.

0

I once had a similar problem, it turned out to be simple syntax problem. Somewhere in a document I had a syntax error but I showed the error to me almost at the end of that document. So I'd advise yoCheck your parentheses, quotes and commas.

cete3
  • 146
  • 1
  • 6