community.general/lib/ansible/modules/cloud
Ryan Brown b091d39baf Handle termination_protection parameter when restarting instances (#5076)
* Restart EC2 instances with multiple network interfaces

A previous bug, #3234, caused instances with multiple ENI's to fail when being
started or stopped because sourceDestCheck is a per-interface attribute, but we
use the boto global access to it (which only works when there's a single ENI).

This patch handles a variant of that bug that only surfaced when restarting an
instance, and catches the same type of exception.

* Default termination_protection to None instead of False

AWS defaults the value of termination_protection to False, so we don't
need to explicitly send `False` when the user hasn't specified a
termination protection level. Before this patch, the below pair of tasks
would:

1. Create an instance (enabling termination_protection)
2. Restart that instance (disabling termination_protection)

Now, the default None value would prevent the restart task from
disabling termination_protection.

```
- name: make an EC2 instance
  ec2:
    vpc_subnet_id: {{ subnet  }}
    instance_type: t2.micro
    termination_protection: yes
    exact_count: 1
    count_tag:
       Name: TestInstance
    instance_tags:
       Name: TestInstance
    group_id: {{ group }}
    image: ami-7172b611
    wait: yes
- name: restart a protected EC2 instance
  ec2:
    vpc_subnet_id: {{ subnet  }}
    state: restarted
    instance_tags:
       Name: TestInstance
    group_id: {{ group }}
    image: ami-7172b611
    wait: yes
```
2016-12-08 11:25:18 -05:00
..
amazon Handle termination_protection parameter when restarting instances (#5076) 2016-12-08 11:25:18 -05:00
azure ssh_public_keys on Azure virtual machine is a list (#4350) 2016-12-08 11:24:53 -05:00
digital_ocean Remove duplicate keys from module docs. (#4920) 2016-12-08 11:25:11 -05:00
docker Let docker-py handle decoding and JSON parsing of stream data. Fixes #4930. 2016-12-08 11:25:14 -05:00
google Support for GCE Managed Instance Groups. (#4541) 2016-12-08 11:25:09 -05:00
linode Py3 exclude list (#3698) 2016-12-08 11:24:29 -05:00
openstack Fix os_network's create_network() call for older shade versions (#5058) 2016-12-08 11:25:14 -05:00
rackspace Fixing Rackspace compile time errors irt exception handling for Python 3 (#3849) 2016-12-08 11:24:34 -05:00
vmware Port vsphere_guest to py3/py2.4 syntax (#3721) 2016-12-08 11:24:30 -05:00
__init__.py package files 2016-12-08 11:22:22 -05:00