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

Merge pull request #8459 from jsmartin/ec2_lc_public_ip

Adds support for public_ip boolean for launch configurations.
This commit is contained in:
Michael DeHaan 2014-08-08 13:08:26 -04:00
commit 039e4571b9

View file

@ -79,6 +79,13 @@ options:
required: false
default: false
aliases: []
assign_public_ip:
description:
- whether instances in group are launched with a public IP.
required: false
default: false
aliases: []
version_added: "1.8"
extends_documentation_fragment: aws
"""
@ -139,6 +146,7 @@ def create_launch_config(connection, module):
instance_type = module.params.get('instance_type')
spot_price = module.params.get('spot_price')
instance_monitoring = module.params.get('instance_monitoring')
assign_public_ip = module.params.get('assign_public_ip')
bdm = BlockDeviceMapping()
if volumes:
@ -159,7 +167,8 @@ def create_launch_config(connection, module):
block_device_mappings=[bdm],
instance_type=instance_type,
spot_price=spot_price,
instance_monitoring=instance_monitoring)
instance_monitoring=instance_monitoring,
associate_public_ip_address = assign_public_ip )
launch_configs = connection.get_all_launch_configurations(names=[name])
changed = False
@ -201,6 +210,7 @@ def main():
state=dict(default='present', choices=['present', 'absent']),
spot_price=dict(type='float'),
instance_monitoring=dict(default=False, type='bool'),
assign_public_ip=dict(default=False, type='bool')
)
)