puppet - Puppet 无法获取 gpg 密钥
问题描述
我正在使用 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-z\d])([a-z\d-]{0,61}\.)+[a-z\d]+(:\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
, puppet 不再出错,而是返回
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'],
]
}
推荐阅读
- node.js - “错误”:当我运行我正在使用 MERN 堆栈的代码时,邮递员中的“访问被拒绝”
- reactjs - 是否可以在带有 pug 的 React 中使用 Framer Motion
- elixir - 如何在使用 Elixir/Phoenix 进行编辑期间使文件上传字段保持一致?
- git-bash - gitbash 更改默认目录
- excel - 在excel中一次打开选定列中的所有超链接
- python - tqdm 进度条之间的空间太宽
- wordpress - 多文件上传字段的 GravityForm 预览缩略图
- ruby-on-rails - 运行 hotwire:install 后,无法推送到 Heroku
- python - 将字符串分配给空列表以转换为 char wise 列表,如何理解?
- c# - 查找用户输入的字符串是什么数据类型?