puppet 的新手并试图让这个模块工作,但发现它非常令人沮丧。
Error: Could not retrieve catalog from remote server: Error 400 on SERVER: can't convert String into Hash at /etc/puppet/modules/collectd/manifests/plugin/network.pp:28
我正在努力的插件是这个: https ://forge.puppetlabs.com/pdxcat/collectd#class-collectdpluginnetwork
我尝试设置的值是我尝试过的 collectd::plugin::network 下的服务器:
('127.0.0.1': port => 25826,) and
('hostname' '127.0.0.1' 'port' 25826) and '127.0.0.1': port => 25826,
以及无数其他选择。
有人可以让我知道如何编写有效的哈希吗?
清单:
[root@foreman ~]# cat /etc/puppet/modules/collectd/manifests/plugin/network/server.pp
#
define collectd::plugin::network::server (
$ensure = 'present',
$username = undef,
$password = undef,
$port = undef,
$securitylevel = undef,
$interface = undef,
) {
include collectd::params
include collectd::plugin::network
$conf_dir = $collectd::params::plugin_conf_dir
validate_string($name)
file { "${conf_dir}/network-server-${name}.conf":
ensure => $ensure,
mode => '0640',
owner => 'root',
group => $collectd::params::root_group,
content => template('collectd/plugin/network/server.conf.erb'),
notify => Service['collectd'],
}
}