|
|
@ -97,6 +97,13 @@ options:
|
|
|
|
- The number of secondary IP addresses to assign to the network interface. This option is mutually exclusive of secondary_private_ip_addresses
|
|
|
|
- The number of secondary IP addresses to assign to the network interface. This option is mutually exclusive of secondary_private_ip_addresses
|
|
|
|
required: false
|
|
|
|
required: false
|
|
|
|
version_added: 2.2
|
|
|
|
version_added: 2.2
|
|
|
|
|
|
|
|
allow_reassignment:
|
|
|
|
|
|
|
|
description:
|
|
|
|
|
|
|
|
- Indicates whether to allow an IP address that is already assigned to another network interface or instance
|
|
|
|
|
|
|
|
to be reassigned to the specified network interface.
|
|
|
|
|
|
|
|
required: false
|
|
|
|
|
|
|
|
default: 'no'
|
|
|
|
|
|
|
|
version_added: 2.7
|
|
|
|
extends_documentation_fragment:
|
|
|
|
extends_documentation_fragment:
|
|
|
|
- aws
|
|
|
|
- aws
|
|
|
|
- ec2
|
|
|
|
- ec2
|
|
|
@ -365,6 +372,7 @@ def modify_eni(connection, vpc_id, module, eni):
|
|
|
|
secondary_private_ip_addresses = module.params.get("secondary_private_ip_addresses")
|
|
|
|
secondary_private_ip_addresses = module.params.get("secondary_private_ip_addresses")
|
|
|
|
purge_secondary_private_ip_addresses = module.params.get("purge_secondary_private_ip_addresses")
|
|
|
|
purge_secondary_private_ip_addresses = module.params.get("purge_secondary_private_ip_addresses")
|
|
|
|
secondary_private_ip_address_count = module.params.get("secondary_private_ip_address_count")
|
|
|
|
secondary_private_ip_address_count = module.params.get("secondary_private_ip_address_count")
|
|
|
|
|
|
|
|
allow_reassignment = module.params.get("allow_reassignment")
|
|
|
|
changed = False
|
|
|
|
changed = False
|
|
|
|
|
|
|
|
|
|
|
|
try:
|
|
|
|
try:
|
|
|
@ -401,7 +409,7 @@ def modify_eni(connection, vpc_id, module, eni):
|
|
|
|
connection.assign_private_ip_addresses(network_interface_id=eni.id,
|
|
|
|
connection.assign_private_ip_addresses(network_interface_id=eni.id,
|
|
|
|
private_ip_addresses=secondary_addresses_to_add,
|
|
|
|
private_ip_addresses=secondary_addresses_to_add,
|
|
|
|
secondary_private_ip_address_count=None,
|
|
|
|
secondary_private_ip_address_count=None,
|
|
|
|
allow_reassignment=False, dry_run=False)
|
|
|
|
allow_reassignment=allow_reassignment, dry_run=False)
|
|
|
|
changed = True
|
|
|
|
changed = True
|
|
|
|
if secondary_private_ip_address_count is not None:
|
|
|
|
if secondary_private_ip_address_count is not None:
|
|
|
|
current_secondary_address_count = len(current_secondary_addresses)
|
|
|
|
current_secondary_address_count = len(current_secondary_addresses)
|
|
|
@ -411,7 +419,7 @@ def modify_eni(connection, vpc_id, module, eni):
|
|
|
|
private_ip_addresses=None,
|
|
|
|
private_ip_addresses=None,
|
|
|
|
secondary_private_ip_address_count=(secondary_private_ip_address_count -
|
|
|
|
secondary_private_ip_address_count=(secondary_private_ip_address_count -
|
|
|
|
current_secondary_address_count),
|
|
|
|
current_secondary_address_count),
|
|
|
|
allow_reassignment=False, dry_run=False)
|
|
|
|
allow_reassignment=allow_reassignment, dry_run=False)
|
|
|
|
changed = True
|
|
|
|
changed = True
|
|
|
|
elif secondary_private_ip_address_count < current_secondary_address_count:
|
|
|
|
elif secondary_private_ip_address_count < current_secondary_address_count:
|
|
|
|
# How many of these addresses do we want to remove
|
|
|
|
# How many of these addresses do we want to remove
|
|
|
@ -561,6 +569,7 @@ def main():
|
|
|
|
secondary_private_ip_addresses=dict(default=None, type='list'),
|
|
|
|
secondary_private_ip_addresses=dict(default=None, type='list'),
|
|
|
|
purge_secondary_private_ip_addresses=dict(default=False, type='bool'),
|
|
|
|
purge_secondary_private_ip_addresses=dict(default=False, type='bool'),
|
|
|
|
secondary_private_ip_address_count=dict(default=None, type='int'),
|
|
|
|
secondary_private_ip_address_count=dict(default=None, type='int'),
|
|
|
|
|
|
|
|
allow_reassignment=dict(default=False, type='bool'),
|
|
|
|
attached=dict(default=None, type='bool')
|
|
|
|
attached=dict(default=None, type='bool')
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
|
|
|