成功:
$ sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 9DA31620334BD75D9DCB49F368818C72E52529D4
Executing: /tmp/apt-key-gpghome.TgkaWkin7p/gpg.1.sh --keyserver hkp://keyserver.ubuntu.com:80 --recv 9DA31620334BD75D9DCB49F368818C72E52529D4
gpg: key 68818C72E52529D4: public key "MongoDB 4.0 Release Signing Key <packaging@mongodb.com>" imported
gpg: Total number processed: 1
gpg: imported: 1
但这失败了:
- name: install_mongodb.yml --> Add apt-key for mongodb repository
apt_key:
id: 9DA31620334BD75D9DCB49F368818C72E52529D4
keyserver: keyserver.ubuntu.com
出现此错误:
fatal: [mongodb_primary_1]: FAILED! => changed=false
cmd: /usr/bin/apt-key adv --no-tty --keyserver keyserver.ubuntu.com --recv 9DA31620334BD75D9DCB49F368818C72E52529D4
msg: 'Error fetching key 9DA31620334BD75D9DCB49F368818C72E52529D4 from keyserver: keyserver.ubuntu.com'
rc: 2
stderr: |-
gpg: requesting key E52529D4 from hkp server keyserver.ubuntu.com
gpg: no valid OpenPGP data found.
gpg: Total number processed: 0
gpg: keyserver communications error: keyserver helper general error
gpg: keyserver communications error: unknown pubkey algorithm
gpg: keyserver receive failed: unknown pubkey algorithm
stderr_lines:
- 'gpg: requesting key E52529D4 from hkp server keyserver.ubuntu.com'
- 'gpg: no valid OpenPGP data found.'
- 'gpg: Total number processed: 0'
- 'gpg: keyserver communications error: keyserver helper general error'
- 'gpg: keyserver communications error: unknown pubkey algorithm'
- 'gpg: keyserver receive failed: unknown pubkey algorithm'
stdout: |-
Executing: /tmp/tmp.e0jptD7eDI/gpg.1.sh --no-tty
--keyserver
keyserver.ubuntu.com
--recv
9DA31620334BD75D9DCB49F368818C72E52529D4
gpgkeys: key 9DA31620334BD75D9DCB49F368818C72E52529D4 can't be retrieved
stdout_lines: <omitted>
这可以在vagrant
预配器的ansible
机器中运行
很重要;
有什么主意吗?