【发布时间】:2016-10-18 10:56:20
【问题描述】:
我正在尝试使用 ansible 在 vagrant 虚拟机中安装 java 我如何键入“ansible-playbook”命令输出返回此错误:
失败了! => {“更改”:假,“cmd”:“apt-key add -”,“失败”:真, "msg": "gpg: 没有找到有效的 OpenPGP 数据。", "rc": 2, "stderr": "gpg: 未找到有效的 OpenPGP 数据。\n", "stdout": "", "stdout_lines": []}
.yml 文件是这样的:
- name: Add the webupd8 APT repository key
tags:
- java
- java-webupd8
apt_key: data="{{ lookup('file', 'webupd8.key.asc') }}" state=present
# Use a static file because right now using just an ID fails
- name: Add the webupd8 APT repository
tags:
- java
- java-webupd8
apt_repository: repo="deb http://ppa.launchpad.net/webupd8team/java/ubuntu precise main" state=present
好吧,我想那是因为我在 apt_key 变量中输入了错误的值,但我不知道应该在上面输入什么。
提前致谢
【问题讨论】: