0

I am getting an error of err: Could not retrieve catalog from remote server: Error 400 on SERVER: Invalid parameter port at /etc/puppet/manifests/nodes/node.pp:652 on node test-puppet

My puppet class: (The Line 652 at node.pp)

node 'test-puppet'  {
  class { 'syslog_ng':
     host    => "newhost",
     ip      => "192.168.1.10",
     port    => "1999",
     logfile => "/var/log/test.log",
  }
}

On the module side

class syslog_ng::config (
  $host ,
  $ip  ,
  $port,
  $logfile){

  file {'/etc/syslog-ng/syslog-ng.conf':
    ensure  => present,
    owner   => 'root',
    group   => 'root',
    content => template('syslog-ng/syslog-ng.conf.erb'),
    notify  => Service['syslog-ng'],
    require => Class['syslog_ng::install'],
  }
  file {"/etc/syslog-ng/conf/${host}.conf":
    ensure  => present,
    owner   => 'root',
    group   => 'root',
    notify  => Service['syslog-ng'],
    content => template("syslog-ng/${host}.conf.erb"),
    require => Class['syslog_ng::install'],
  }

}

I think I am doing it as per the puppet documentation.

chandank
  • 847
  • 3
  • 14
  • 31
  • BTW, what exactly is on line number `652`? That `652` is the line number of the particular file you should be looking at. – Zoredache Oct 24 '12 at 21:22
  • the line 652 is `node 'test-puppet' {` – chandank Oct 24 '12 at 22:27
  • 1
    Ok, next question. Shouldn't it be `class { 'syslog_ng::config':` instead of `class { 'syslog_ng':`? – Zoredache Oct 24 '12 at 22:39
  • Actually I already have that class defined, in my init.pp file.`class syslog_ng { include syslog_ng::install,syslog_ng::service }` and then I have different files for each component `manifests]$ ls config.pp init.pp install.pp service.pp` – chandank Oct 24 '12 at 23:10
  • 1
    I think you missed the point. If you are calling `syslog_ng`, then shouldn't it be the class with the parameters? – Zoredache Oct 24 '12 at 23:19
  • THANK YOU! how stupid I could be. My whole day went in debugging this and later I realized it was such an stupid typo!. – chandank Oct 24 '12 at 23:32

1 Answers1

1

This was a great example of super Type error I did. So guys anybody who is struggling just look at my question and main problem was calling syslog_ng rather than syslog_ng::config at the node level. I know this is super stupid but happens.

chandank
  • 847
  • 3
  • 14
  • 31