Dear dick,
I have to install aws ec2 instances through ansible-playbook,I am getting this error,kindly help me
ERROR! A playbook must be a list of plays, got a <class 'ansible.parsing.yaml.objects.AnsibleMapping'> instead
The error appears to be in '/etc/ansible/task.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: webserver
^ here
this is code, kindly help me
---
Name: webserver
hosts: centos
connection: local
tasks:
- name: launching ec2
ec2:
instance_type: t2.micro
key_name: cgs
image: ami-04be797e37992bf1e
region: us-west-1
group: default
count: 1
vpc_subnet_id: subnet-094c33691ee761fe0
wait: yes
assign_public_ip: yes
~
Thanks & regards,
Prasanna Kumar .S