I’ve been working on a change to ec2_snapshot to add a ‘list’ option to the state parameter. This would function in a similar way to the list option in the ec2_vol module.
I have a few thing for discussion…
- Should this be additional functionality of ec2_snapshot or a separate module? I think it should be additional functionality because it’s similar functionality to what was added in ec2_vol
- I would like to be able to filter the list of snapshots returned. The supported filters are listed here - http://docs.aws.amazon.com/AWSEC2/latest/CommandLineReference/ApiReference-cmd-DescribeSnapshots.html. Some of these fields are already part of the module. E.g. volume_id My question is do i add a new parameter called “filter” where you specify the filter as a string, or do I take the existing fields such as volume_id to construct the filter pattern?
E.g.
ec2_snapshot: state=list volume_id=vol-123456
or
ec2_snapshot: state=list filter=“volume_id: vol-123456”
The reason for this dev is a similar use case as outlined here - https://groups.google.com/forum/#!searchin/ansible-devel/ec2_snapshot/ansible-devel/55hRqyNFK8c/l0JHdZMG_k0J.