Changes in ec2.py that will break things

54 views
Skip to first unread message

Navid Paya

unread,
May 6, 2015, 11:24:26 PM5/6/15
to ansible...@googlegroups.com

Hi guys

I've already posted this to the Tower support channel but was told to post it here as well since this is part of Ansible Core rather than Ansible Tower.


I have an older version of ec2.py and ec2.ini checked into my repo from a while ago. Today I decided to update it. After that none of my playbooks matched my EC2 instances and I got empty host lists from pretty much everything. So I started looking around. What I found out is that the new one changes all "-" in my tag names to "_". Just wanted to know if Tower uses the same ec2.py script because in that case everything will break for me when this is released to Tower.

For instance I have an autoscaling group called "prd-gamma-api". With the old script, I can find its members using "tag_aws_autoscaling_groupName_prd-gamma-api" but in the new one it's "tag_aws_autoscaling_groupName_prd_gamma_api". You can see the result is this gist:

https://gist.github.com/navidpaya/0b6f7c349a84a0041356

And if this is going to be the behavior, I think it's a very bad one. Why would the script tamper with the tags that AWS accepts? It would cause a lot of confusion.

Cheers

Navid

Brian Coca

unread,
May 7, 2015, 10:16:27 AM5/7/15
to ansible...@googlegroups.com
The issue is that - in the group names breaks things, it still works
for matching hosts to a play but it makes it difficult to use other
features as python does not like '-' in variables or as dictionary
keys.

--
Brian Coca

Navid Paya

unread,
May 7, 2015, 10:24:44 AM5/7/15
to ansible...@googlegroups.com

I agree and I was personally opposed to them being used but again, if - is allowed by AWS, changing them in Ansible is just too intrusive since this plugin is used only by EC2 instances. Is it possible to  at least have an option to make the script act in the old way?


--
You received this message because you are subscribed to a topic in the Google Groups "Ansible Project" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ansible-project/IS2j-Q9uRQI/unsubscribe.
To unsubscribe from this group and all its topics, 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/CAJ5XC8m3bCfyQu9cye1ka4e8wxR8%3DW9%2Bd%2BOxow3CvkCc5iY6Xw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Brian Coca

unread,
May 7, 2015, 10:31:56 AM5/7/15
to ansible...@googlegroups.com
I would not be opposed to make this configurable via ec2.ini, I would
make it default to the new behavior just to avoid more problems in the
future.



--
Brian Coca

Navid Paya

unread,
May 7, 2015, 11:34:57 AM5/7/15
to ansible...@googlegroups.com
That would totally work for me. Thanks, Brian.




--
Brian Coca

--
You received this message because you are subscribed to a topic in the Google Groups "Ansible Project" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ansible-project/IS2j-Q9uRQI/unsubscribe.
To unsubscribe from this group and all its topics, 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