我正在编写我的第一个Ansible攻略,以从AWS获取一些实例详细信息,但我无法正确地获取攻略。我得到了这个错误:ERROR! playbooks must be a list of plays
。
下面是我的攻略。
#get vailable instance details
-name: "Create and attach ebs volumes"
tasks:
ec2_instance_facts:
region: us-west-2
filter :
"tag:role": PrimaryApplicationInstance
发布于 2019-03-22 15:00:00
ansible中的攻略遵循一些语法和格式。
请在下面使用:
---
- name: <name of the playbook>
hosts: <hosts_group>
tasks:
- name: <name of the task for reference>
ec2_instance_facts:
<module arguments>
ansible遵循yaml格式的2个空格的缩进。
由于您是新手,您可以使用下面的命令检查攻略的语法。
ansible-playbook --syntax-check <playbook_file_name>.yml -i inventory
-i --> inventory file where hosts and vars can be defined in the format
<var_name> = <var_value>
https://stackoverflow.com/questions/55293628
复制相似问题