刚接触 Puppet,所以可能有些简单。无法理解为什么下面的清单不起作用。在代理上运行时,我收到以下错误:
无法解析环境生产:/etc/puppet/manifests/site.pp:14 处“=”处语法错误;预期“}”
node 'linuxlab' {
include apt
apt::unattended_upgrades {
origins = $::apt::params::origins,
update = '1',
download = '1',
upgrade = '1',
autoclean = '7',
}
}
答案1
您不能使用=
来将参数传递给类。
=>
用于此目的。
=
用于为变量赋值。
因此该代码应更改为:
node 'linuxlab' {
include apt
apt::unattended_upgrades {
origins => $::apt::params::origins,
update => '1',
download => '1',
upgrade => '1',
autoclean => '7',
}
}