Ansible 错误说明:“apt_repository"不是 Play 的有效属性 [英] Ansible error stating: 'apt_repository' is not a valid attribute for a Play
本文介绍了Ansible 错误说明:“apt_repository"不是 Play 的有效属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试使用以下内容运行剧本:ansible-playbook 角色/java/tasks/debian.yml -i/etc/ansible/hosts
I am trying to just run a playbook with:
ansible-playbook roles/java/tasks/debian.yml -i /etc/ansible/hosts
输出如下:
ERROR! 'apt_repository' is not a valid attribute for a Play
The error appears to have been in '/Users/awest1/Workspace/ansible-playbooks/roles/java/tasks/debian.yml': line 2, column 3, but may
be elsewhere in the file depending on the exact syntax problem.
The offending line appears to be:
---
- name: Setup oracle java deb repo
^ here
<小时>
我试图播放的 yml 文件有这个头:
The yml file that I am trying to play has this head:
- name: Setup oracle java deb repo
apt_repository:
repo: "ppa:webupd8team/java"
update_cache: yes
我很感激给出的任何指示.谢谢
I would appreciate any direction given. Thanks
推荐答案
您尝试将任务列表作为剧本运行.
You try to run tasks list as a playbook.
要让它发挥作用,请编写一个简单的剧本:
To make it work, write a simple playbook:
- hosts: all
tasks:
- include: roles/java/tasks/debian.yml
这篇关于Ansible 错误说明:“apt_repository"不是 Play 的有效属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文