Ansible extra modules - ec2_vpc_subnet

Hi,

I have installed ansible on centos 6 and it seems that I am getting the error : state is not legal…

[user@server tasks]$ ansible-playbook -v -i /home/user/ansible/ansible_hosts /home/user/ansible/amazon_vpc.yml
ERROR: state is not a legal parameter in an Ansible task or handler

[user@server tasks]$ cat main.yml

Can you show us the contents of the amazon_vpc.yml playbook.

Hi,
Here you go :

/home/user/ansible/amazon_vpc.yml

  • hosts: localhost
    gather_facts: true

roles:

  • load-balancer

/home/user/ansible/roles/load-balancer/tasks/main.yml

You need to indent the task’s parameters:

- ec2_vpc_subnet:
    state: present
    vpc_id: vpc-1dfdf3e
    az: ap-southeast-1b
    cidr: 10.170.1.0/24
    resource_tags: Test