I’m trying to automate creating an AWS VPC with routes, subnets, instances, RDS, etc.
so I created the following yml:
Can you please try this:
- debug: var=“{{ item.id }}”
when: vpc.subnets.az == “{{Azone1}}”
with_items: vpc.subnets
for individual you can get like this but I am not sure: - debug: var=vpc.subnets[0].id
when: vpc.subnets.az == “{{Azone1}}”
For complete example, please refer this:
https://github.com/arbabnazar/ansible-aws-vpc-ha-wordpress/blob/master/aws/tasks/vpc.yml
Thanks,