ansible/ansible-modules-core — pull request #76 by hkariti (2014-09-30 11:17:58+00:00)
Title: ec2_snapshot idempotency feature + some other changes

Added a snapshot_max_age parameter, that allows you to check for an existing snapshot to the volume and only create a new one if it's older than a given age.

"Side" changes:

- Added snapshot_max_age, wait and wait_timeout to the docs (included a correct `version_added` of 1.6, when these parameters were first added)
- Made the default value of wait to be false. This restores the behavior to what it was before ansible/ansible#6697.

Example for snapshot_max_age:

- ec2_snapshot: volume_id={{volume_id}} region={{region}} snapshot_max_age=60
register: snapshot

If there's no snapshot for this volume, or if the latest snapshot is older that 60 minutes, a new one will be created (snapshot.changed is true).

If there's a snapshot that's newer than 60 minutes (even if it's in progress) the module will not create a snapshot (snapshot.changed is false), and the info returned to snapshot will be the info of the found snapshot.

If the newest snapshot is currently in progress and wait is set to true, the module will wait for it to complete before returning.