1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Merge branch 'drcapulet/ec2-sourcedestcheck' of https://github.com/drcapulet/ansible into drcapulet-drcapulet/ec2-sourcedestcheck

This commit is contained in:
James Cammarata 2014-03-11 10:56:44 -05:00
commit 5d4980459f

View file

@ -184,6 +184,12 @@ options:
required: false
default: null
aliases: []
source_dest_check:
version_added: "1.5"
description:
- Enable or Disable the Source/Destination checks (for NAT instances and Virtual Routers)
required: false
default: true
state:
version_added: "1.3"
description:
@ -724,6 +730,7 @@ def create_instances(module, ec2, override_count=None):
volumes = module.params.get('volumes')
exact_count = module.params.get('exact_count')
count_tag = module.params.get('count_tag')
source_dest_check = module.boolean(module.params.get('source_dest_check'))
# group_id and group_name are exclusive of each other
if group_id and group_name:
@ -876,6 +883,11 @@ def create_instances(module, ec2, override_count=None):
for inst in this_res.instances:
running_instances.append(inst)
# Enabled by default by Amazon
if not source_dest_check:
for inst in res.instances:
inst.modify_attribute('sourceDestCheck', False)
instance_dict_array = []
created_instance_ids = []
for inst in running_instances:
@ -1049,6 +1061,7 @@ def main():
private_ip = dict(),
instance_profile_name = dict(),
instance_ids = dict(type='list'),
source_dest_check = dict(type='bool', default=True),
state = dict(default='present'),
exact_count = dict(type='int', default=None),
count_tag = dict(),