我正在尝试按照“PGP”此处下的说明安装ruby-install,但通过 Ansible playbook 进行安装。
剧本现在在语法上出现错误,下面的“gpg:”行。
我在谷歌上搜索了很多,但仍然没有找到让我喜欢这个概念的例子。 在 gpg 上找不到 Ansible 文档。
这与构建可轻松重现且易于更改控制的 Vagrant dev vm 有关,因此我不想通过在 VM 启动后仅从命令行或通过另一个脚本进行安装来增加复杂性。
- name: get gpg for ruby install via the postmodern developer
get_url:
url: https://raw.github.com/postmodern/postmodern.github.io/master/postmodern.asc
dest: /tmp/postmodern.asc
- name: import gpg key
gpg:
key_file: /tmp/postmodern.asc
# To do later:
# wget https://raw.github.com/postmodern/ruby-install/master/pkg/ruby-#install-0.7.0.tar.gz.asc
# gpg --verify ruby-install-0.7.0.tar.gz.asc ruby-install-0.7.0.tar.gz
我期望使用gpg命令将文件中的gpg密钥添加到系统的集合中,但结果如下:
[WARNING]: Ansible is in a world writable directory (/vagrant), ignoring it as an ansible.cfg source.
Using /etc/ansible/ansible.cfg as config file
ERROR! no action detected in task
The error appears to have been in '/vagrant/ansible/roles/framework/tasks/main.yml': line 15, column 3, but may
be elsewhere in the file depending on the exact syntax problem.
The offending line appears to be:
- name: import gpg key
^ here
Ansible failed to complete successfully. Any error output should be
visible above. Please fix these errors and try again.