You can write a module or a simple filter that will give you the
availability zones in a region.
https://github.com/linuxdynasty/ld-ansible-filters/blob/master/filter_plugins/aws.py#L202
So you can do something like this
*zones: "{{ aws_region | zones() }}"*


​

On Mon, Aug 1, 2016 at 8:52 AM, <[email protected]> wrote:

> I'm not sure if I'm overlooking this or not, but is there a module from
> Ansible that will describe the availability zones in my AWS region?
>
> I typically use us-east-1 as my default region, which has 5 available
> availability zones (A,B, C, D, E), out of which I can only use 4.  I never
> know which ones are available to me when I stand up my VPC and create my
> subnets.
>
> So my desire is to simply describe availability zones with an ansible
> module, and NOT pass the aws cli ec2 describe-availability-zones through
> with a `command` in my role.
>
> Thank you.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Ansible Project" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/03da1b58-e9bd-40ea-959f-1c58bc5d635a%40googlegroups.com
> <https://groups.google.com/d/msgid/ansible-project/03da1b58-e9bd-40ea-959f-1c58bc5d635a%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAH2deCa2fhFYSeRK55DvJ2gy3WJDNAMHj0k3ODPTFYvCa4dPpg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to