ansible-剧本:"Failed to update cache: unknown reason"

ansible-playbook: "Failed to update cache: unknown reason"

我正在尝试部署 kypo 网络靶场并正在关注 its official guide。使用 ansible-playbook 部署整个范围时,我遇到了上述错误:

TASK [docker : install prerequisites] ******************************************************************
fatal: [192.168.211.208]: FAILED! => {"changed": false, "msg": "Failed to update apt cache: unknown reason"}

我已经手动检查了 apt-get update,最初给我的通知是:

N: Skipping acquire of configured file 'stable/binary-i386/Packages' as repository 'https://download.docker.com/linux/ubuntu focal InRelease' doesn't support architecture 'i386'

我按照 this 添加了 [amd=64] to repository 以清除错误。现在 apt-get update 运行时没有任何警告或错误,但 ansible-playbook 继续生成此错误。

我更改了详细级别并得到:

fatal: [192.168.211.208]: FAILED! => {
    "changed": false,
    "invocation": {
       "module_args": {
            "allow_unauthenticated": false,
            "autoclean": false,
            "autoremove": false,
            "cache_valid_time": 0,
            "deb": null,
            "default_release": null,
            "dpkg_options": "force-confdef,force-confold",
            "force": false,
            "force_apt_get": false,
            "install_recommends": null,
            "name": [
                "apt-transport-https",
                "ca-certificates"
            ],
            "only_upgrade": false,
            "package": [
                "apt-transport-https",
                "ca-certificates"
            ],
            "policy_rc_d": null,
            "purge": false,
            "state": "present",
            "update_cache": true,
            "update_cache_retries": 5,
            "update_cache_retry_max_delay": 12,
            "upgrade": null
        }
    },
    "msg": "Failed to update apt cache: unknown reason"
 }

我该如何解决这个问题?

在 Kypo CRP 中,在播放 ansible 剧本时,错误实际上来自 openstack 的一个实例,我通过增加命令的冗长程度发现了该实例 -vvvv。主机一切正常。所以我寻找实例的变化,根本原因是没有互联网访问。一旦我设法将它们连接到外部世界,错误就消失了。