You can get an idempotent ec2 task using the instance_tags, exact_count, and count_tag options. The IP addresses are more limited because the module uses the old boto library which is no longer actively maintained by AWS.
I’m not aware of any plans to deprecate the ec2 module in the near future. The ec2_instance module is preview status as there are still some things to be fixed, like you’ve found. I think the current state of things is that features can be added to ec2_instance, but not ec2 (we try to avoid adding more boto-dependent code). The ec2 module can still receive bug fixes, but since it uses the boto library which isn’t getting patched for its own bugs or updated with features there are issues that won’t be able to be resolved in that module. Those problems can be fixed in ec2_instance since that module uses boto3. -- Sloane On Monday, March 25, 2019 at 10:33:59 AM UTC-5, Dick Visser wrote: > > Hi > > While trying to debug some issues (notably trying to add several security > groups to an EC2 instance), I once again ran into the question about which > ansible module to use to for EC2 instances. > > From the docs it appears that both the ec2 and the ec2_instance module are > supported, with the latter being the newest, and they do largely the same > things. > I've shuffled around the ec2_instance task into an ec2 task, and I was > able to get that to work with multiple security groups. > But now I'm having a hard time getting this new ec2 task to be idempotent, > and also the way that IP addresses are assigned is more limited than > ec2_instance. > > I'm wary of picking the "old" ec2 module for my tasks, or mixing the two, > because I suspect ec2 might get deprecated some time soon in favor of the > ec2_instance module. > > I couldn't find any statement or road map on this topic - is there a long > term plan or a road map wrt the two EC2 modules? If so, I can at least make > a sound decision on where to spend energy, also in terms of fixing issues. > > > thx > > > -- > Dick Visser > Trust & Identity Service Operations Manager > GÉANT > -- 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/c8af610a-9ba3-48f5-b94f-8b7542f334ee%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
