我试图在上安装一个基本的apache2,在运行剧本时,我得到了以下特定的错误消息: PLAY [Ansible Playbook to Install and Setup Apache on Ubuntu] *******************************************************************************************************************
TASK [Gathering Facts] **********************************************************************************************************************************************************
ok: [localhost]
TASK [Install latest version of Apache] *****************************************************************************************************************************************
fatal: [localhost]: FAILED! => {"changed": false, "msg": "Failed to update apt cache: unknown reason"}
PLAY RECAP **********************************************************************************************************************************************************************
localhost : ok=1 changed=0 unreachable=0 failed=1 skipped=0 rescued=0 ignored=0 在主游戏簿上,主机变量已经设置为"localhost“。我不知道我已经尝试使用这两个命令,但它们都没有工作。 ansible-playbook playbook.yml --connection=localansible-playbook playbook.yml补充一下,下面是详细的消息: fatal: [localhost]: FAILED! => {
"changed": false,
"invocation": {
"module_args": {
"allow_change_held_packages": false,
"allow_downgrade": false,
"allow_unauthenticated": false,
"autoclean": false,
"autoremove": false,
"cache_valid_time": 0,
"clean": false,
"deb": null,
"default_release": null,
"dpkg_options": "force-confdef,force-confold",
"fail_on_autoremove": false,
"force": false,
"force_apt_get": false,
"install_recommends": null,
"lock_timeout": 60,
"name": "apache2",
"only_upgrade": false,
"package": [
"apache2"
],
"policy_rc_d": null,
"purge": false,
"state": "latest",
"update_cache": true,
"update_cache_retries": 5,
"update_cache_retry_max_delay": 12,
"upgrade": null
}
},
"msg": "Failed to update apt cache: unknown reason"
}
|