EC2 instances with tagged volumes that delete on termination

101 views
Skip to first unread message

Brenda Bell

unread,
Apr 4, 2015, 11:00:37 AM4/4/15
to ansible...@googlegroups.com
The subject says what I'm trying to do.

I first tried to create the instances with a volume dictionary, but that method doesn't let me tag the volumes.

I then tried to first create the instances, then create the volumes and attach them, but that method doesn't let me set them to delete on termination.

I finally attempted to create the instances one at a time with a volume dictionary, intending to loop through the volumes and tag them after the fact. But then I ran into the issue where I'm unable to invoke my create-one-instance include in a with_sequential loop.

What am I missing? Or is there simply not a way to do this?

James Cammarata

unread,
Apr 6, 2015, 5:04:42 PM4/6/15
to ansible...@googlegroups.com
Hi Brenda, this has come up before a few times (including from our own QA testing team), but apparently we haven't opened an issue on it to date. Feel free to do so, and we'll take a look at getting it resolved. It's definitely been a problem in the past.

Thanks!

James Cammarata
Director, Ansible Core Engineering
github: jimi-c

--
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/5116a833-b58a-4f4a-b285-658b58183070%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Brenda Bell

unread,
Apr 7, 2015, 9:25:14 AM4/7/15
to ansible...@googlegroups.com
Thanks so much for the response. I'm new to Ansible, so what's the right way to open an issue? I assume I just submit it to the git projects (https://github.com/ansible/ansible/issues), right?

James Cammarata

unread,
Apr 7, 2015, 9:28:20 AM4/7/15
to ansible...@googlegroups.com
Yep, that's it. Let us know if you have any further questions.

Thanks!

James Cammarata
Director, Ansible Core Engineering
github: jimi-c

Brenda Bell

unread,
Apr 7, 2015, 9:14:55 PM4/7/15
to ansible...@googlegroups.com
AHA! I found a work-around.

I create the untagged volumes at the same time I create the instances with the ec2 module. But if I then go back and attempt to create the same volumes with the ec2_vol module using the same device names, it doesn't create or change the volumes, but it *does* give me back a result with all the volume IDs. I can then use the IDs to create my tags.

Messy, but it gives me what I want.
Reply all
Reply to author
Forward
0 new messages