ansible/ansible — pull request #4776 by jlaska (2013-11-01 18:52:19+00:00)
Title: Honor wait on ec2 instance termination

Similar to pull-request #4185, the ec2 module does not honor the `wait` and `wait_timeout` parameters on instance termination. This pull request allows the ec2 module to honor those parameters. When `wait` evaluates to `True`, the ec2 module will poll until terminated instances have a `instance-state-name` of `terminated`. If instances have not terminated by the time specified by `wait_timeout` the module calls `module.fail_json(...)`

I have tested and confirmed expected results with the following parameters:
1. `wait: false`
2. `wait: true` (test instances terminate using the default value for `wait_timeout`)
3. `wait: true` and `wait_timeout: 5` (test that the module fails because instances haven't terminated by `wait_timeout`)
4. `wait: true` and `wait_timeout: 1000` (test that instances terminate when a long `wait_timeout` is provided)