我收到错误 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
我的木偶课:(node.pp 第 652 行)
node 'test-puppet' {
class { 'syslog_ng':
host => "newhost",
ip => "192.168.1.10",
port => "1999",
logfile => "/var/log/test.log",
}
}
在模块方面
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'],
}
}
我认为我正在按照傀儡文档进行操作。
答案1
这是我犯的超级类型错误的绝佳示例。所以,任何遇到困难的人只需看看我的问题,主要问题是在节点级别调用 syslog_ng 而不是 syslog_ng::config。我知道这非常愚蠢,但确实会发生。