Module for describing availability zones?

158 views
Skip to first unread message

tom.m...@atlanticbt.com

unread,
Aug 1, 2016, 11:58:49 AM8/1/16
to Ansible Project
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.

Allen Sanabria

unread,
Aug 1, 2016, 12:12:18 PM8/1/16
to ansible...@googlegroups.com
You can write a module or a simple filter that will give you the availability zones in a region.
So you can do something like this 
zones: "{{ aws_region | zones() }}"




--
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 ansible-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/03da1b58-e9bd-40ea-959f-1c58bc5d635a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

tom.m...@atlanticbt.com

unread,
Aug 2, 2016, 10:57:29 AM8/2/16
to Ansible Project
Thanks Allen!

I was trying to avoid creating anything custom, but it looks like a custom module needs to be made.  


Thank you so much.

Allen Sanabria

unread,
Aug 2, 2016, 1:23:15 PM8/2/16
to ansible...@googlegroups.com
A filter as I showed you above would be simpler, than a module imo.

--
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 ansible-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages