You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ansible/cloud
Ryan Brown f1c2739163 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
```
9 years ago
..
amazon Handle termination_protection parameter when restarting instances (#5076) 9 years ago
azure ssh_public_keys on Azure virtual machine is a list (#4350) 9 years ago
digital_ocean Remove duplicate keys from module docs. (#4920) 9 years ago
docker Merge pull request #5050 from chouseknecht/devel 9 years ago
google Support for GCE Managed Instance Groups. (#4541) 9 years ago
linode Py3 exclude list (#3698) 10 years ago
openstack Fix os_network's create_network() call for older shade versions (#5058) 9 years ago
rackspace Fixing Rackspace compile time errors irt exception handling for Python 3 (#3849) 10 years ago
vmware Port vsphere_guest to py3/py2.4 syntax (#3721) 10 years ago
__init__.py package files 11 years ago