我正在使用puppet自动执行以下任务https://www.getenvoy.io/install/envoy/ubuntu/
curl -sL 'https://getenvoy.io/gpg' | sudo apt-key add -
sudo add-apt-repository
"deb [arch=amd64] https://dl.bintray.com/tetrate/getenvoy-deb
$(lsb_release -cs)
stable"
sudo apt-get update && sudo apt-get install -y getenvoy-envoy
我有以下木偶类
class envoy::install {
apt::source { "envoy-${::lsbdistcodename}":
location => 'https://dl.bintray.com/tetrate/getenvoy-deb',
release => $::lsbdistcodename,
repos => 'stable',
key => {
'server' => 'https://getenvoy.io/gpg',
'id' => '5270CEAC57F63EBD9EA9005D0253D0B26FF974DB'
}
}
}
服务器urlhttps://getenvoy.io/gpg
似乎无效,因为模块返回
erver Error: Evaluation Error: Error while evaluating a Resource Statement, Evaluation Error: Error while evaluating a Function Call,
assert_type(): expects a match for
Pattern[/A((hkp|http|https)://)?([a-zd])([a-zd-]{0,61}.)+[a-zd]+(:d{2,5})?$/], got 'https://getenvoy.io/gpg' (file: /srv/puppetmaster/current/environments/envoy_apt/modules/apt/manifests/key.pp, line: 23, column: 5)
如果我将https://getenvoy.io/gpg
更改为https://getenvoy.io
,则木偶不再出错,而是返回
Error: Execution of '/usr/bin/apt-key adv --keyserver https://getenvoy.io --recv-keys 5270CEAC57F63EBD9EA9005D0253D0B26FF974DB' returned 2: Warning: apt-key output should not be parsed (stdout is not a terminal)
Executing: /tmp/apt-key-gpghome.DYIyo3MINv/gpg.1.sh --keyserver https://getenvoy.io --recv-keys 5270CEAC57F63EBD9EA9005D0253D0B26FF974DB
gpg: no valid OpenPGP data found.
puppet是否有一种机制来支持不存储在网站根目录中的gpg密钥?如何让apt::source
在路径中支持/gpg
?
更新
sudo apt-key adv --keyserver https://getenvoy.io/gpg --recv 6FF974DB
Executing: /tmp/apt-key-gpghome.7zAas2TfeV/gpg.1.sh --keyserver https://getenvoy.io/gpg --recv 6FF974DB
gpg: key 0253D0B26FF974DB: public key "GetEnvoy <getenvoy@tetrate.io>" imported
gpg: Total number processed: 1
gpg: imported: 1
sudo apt-key adv --keyserver https://getenvoy.io --recv 6FF974DB
Executing: /tmp/apt-key-gpghome.DG7UFZ6Ogz/gpg.1.sh --keyserver https://getenvoy.io --recv 6FF974DB
gpg: no valid OpenPGP data found.
gpg: Total number processed: 0
sudo apt-key adv --keyserver https://getenvoy.io/gpg --recv 5270CEAC57F63EBD9EA9005D0253D0B26FF974DB
Executing: /tmp/apt-key-gpghome.eCuCy44ieF/gpg.1.sh --keyserver https://getenvoy.io/gpg --recv 5270CEAC57F63EBD9EA9005D0253D0B26FF974DB
gpg: key 0253D0B26FF974DB: "GetEnvoy <getenvoy@tetrate.io>" not changed
gpg: Total number processed: 1
gpg: unchanged: 1
我能够通过拆分apt::source
和apt::key
来解决这个问题
apt::key {'getenvoy':
id => '5270CEAC57F63EBD9EA9005D0253D0B26FF974DB',
source => 'https://getenvoy.io/gpg',
}->
apt::source { "envoy-${::lsbdistcodename}":
location => 'https://dl.bintray.com/tetrate/getenvoy-deb',
release => $::lsbdistcodename,
repos => 'stable',
notify => [
Class['apt::update'],
]
}