我遇到了Ansible剧本的问题。 Ansible正在退出而没有给出任何正确的错误消息。这是我的代码:
- name: Installing dependencies
yum: pkg={{ item }} state=latest
with_items:
- gtk+-devel
- gtk2-devel
我想在CentOS7中安装上面的软件包。我可以通过提供命令sudo yum install gtk+-devel gtk2-devel
手动安装它。但Ansible正在抛出以下信息并退出执行:
TASK [server : Installing dependencies] ****************************
ok: [localhost] => (item=[u'gtk+-devel', u'gtk2-devel'])
NO MORE HOSTS LEFT *************************************************************
to retry, use: --limit @/Users/rolindroy/ansible/setup.retry
PLAY RECAP *********************************************************************
localhost : ok=2 changed=1 unreachable=0 failed=1
Ansible版本:2.1.2.0
修改
使用-vvv
选项运行Playbook会产生此错误(但我可以手动安装):
failed: [localhost] (item=[u'gtk+-devel', u'gtk2-devel']) => {"changed": false, "failed": true, "invocation": {"module_args": {"conf_file": null, "disable_gpg_check": false, "disablerepo": null, "enablerepo": null, "exclude": null, "install_repoquery": true, "list": null, "name": ["gtk+-devel", "gtk2-devel"], "state": "latest", "update_cache": false, "validate_certs": true}, "module_name": "yum"}, "item": ["gtk+-devel", "gtk2-devel"], "msg": "No Package matching 'gtk+-devel' found available, installed or updated", "rc": 0, "results": []}