我不能再安装软件使用列表的项目。
我已经把git评论掉了,看看是否是问题所在。事实证明,nano也会失败。
我的任务是:
- name: Install git, nano, curl, wget, unzip and mercurial
apt: name={{item}} state=installed
with_items:
# - git
- nano
- curl
- wget
- unzip
- mercurial错误:
TASK [common : Install git, nano, curl, wget, unzip and mercurial] *************
failed: [local_vm] (item=[u'nano', u'curl', u'wget', u'unzip', u'mercurial']) => {"failed": true, "item": ["nano", "curl", "wget", "unzip", "mercurial"], "msg": "No package(s) matching '['nano'' available"}在黑暗中捅一针可能是额外的引号?
从我的服务器的控制台:
me@server:~$ sudo apt-get install nano
Reading package lists... Done
Building dependency tree
Reading state information... Done
nano is already the newest version (2.5.3-2ubuntu2)我在运行Anble2.2.0
更新#1
客户端的Python 2.7.6,服务器上的Python2.7.12。
更新#2
要么我被Windows子系统背叛了,要么是Ansible 2.2.0成了问题所在。我在另一个VM (CentOS 7)上进行了尝试,其中安装了Anble2.3,同样的脚本运行得很好。
发布于 2017-09-29 07:03:37
问题在于打包模块的项目压缩。
如果无法更新Ansible版本,请使用ANSIBLE_SQUASH_ACTIONS=[]环境变量作为解决办法。它将增加apt模块的执行时间(因为它将分别对每个项执行),但不会尝试将项连接到单个调用中。
https://stackoverflow.com/questions/46479331
复制相似问题