我无法再使用项目列表安装软件

I can no longer install software using a list of items

我无法再使用项目列表安装软件。

我已注释掉 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)

我是 运行 Ansible 2.2.0

更新 #1

Python 2.7.6 在客户端上,Python 2.7.12 在服务器上。

更新#2

我被 Windows Linux 子系统或 Ansible 2.2.0 背叛了。我在另一个安装了 Ansible 2.3 的虚拟机 (CentOS 7) 上进行了尝试,同样的脚本运行良好。

问题在于压缩包模块的项目。

如果您无法更新 Ansible 版本,请使用 ANSIBLE_SQUASH_ACTIONS=[] 环境变量作为解决方法。 它会增加 apt 模块的执行时间(因为它会对每个项目单独执行),但不会尝试将项目加入单个调用。