我正在使用该模块: https://github.com/puppetlabs/puppetlabs-apt
我配置了下面的类来创建额外的 APT 源并添加 GPG 密钥。
class filebeats_apt {
apt::source { 'Filebeats':
comment => 'Filebeats',
location => 'https://packages.elastic.co/beats/apt',
release => 'stable',
repos => 'main',
key => {
'server' => 'https://packages.elastic.co/GPG-KEY-elasticsearch',
'id' => '30239CC130E1A7FD81A27B140976EAF437D05B5',
},
include => {
'src' => true,
'deb' => true,
},
}
}
我引用主清单中的类如下:
# Puppetpal
node 'puppetpal' {
include filebeats_apt
}
我不断收到以下错误:
Error while evaluating a Resource Statement,
Evaluation Error: Error while evaluating a Function Call, validate_re():
"30239CC130E1A7FD81A27B140976EAF437D05B5" does not match
["\\A(0x)?[0-9a-fA-F]{8}\\Z", "\\A(0x)?[0-9a-fA-F]{16}\\Z", "\\A(0x)?[0-9a-fA-F]{40}\\Z"]
答案1
你发布的 ID 只有 39 个字符,但必须是 8、16 或 40 个字符。我猜你忘了复制一个字符。
附注:
key => {
'server' => 'https://packages.elastic.co/GPG-KEY-elasticsearch',
'id' => '30239CC130E1A7FD81A27B140976EAF437D05B5',
},
server
并且id
不需要引号。