Adds support for public_ip boolean for launch configurations.

This commit is contained in:
James Martin 2014-08-05 12:36:17 -07:00
parent b8783c7555
commit d951ed65ed

View file

@ -79,6 +79,13 @@ options:
required: false required: false
default: false default: false
aliases: [] 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 extends_documentation_fragment: aws
""" """
@ -139,6 +146,7 @@ def create_launch_config(connection, module):
instance_type = module.params.get('instance_type') instance_type = module.params.get('instance_type')
spot_price = module.params.get('spot_price') spot_price = module.params.get('spot_price')
instance_monitoring = module.params.get('instance_monitoring') instance_monitoring = module.params.get('instance_monitoring')
assign_public_ip = module.params.get('assign_public_ip')
bdm = BlockDeviceMapping() bdm = BlockDeviceMapping()
if volumes: if volumes:
@ -159,7 +167,8 @@ def create_launch_config(connection, module):
block_device_mappings=[bdm], block_device_mappings=[bdm],
instance_type=instance_type, instance_type=instance_type,
spot_price=spot_price, 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]) launch_configs = connection.get_all_launch_configurations(names=[name])
changed = False changed = False
@ -201,6 +210,7 @@ def main():
state=dict(default='present', choices=['present', 'absent']), state=dict(default='present', choices=['present', 'absent']),
spot_price=dict(type='float'), spot_price=dict(type='float'),
instance_monitoring=dict(default=False, type='bool'), instance_monitoring=dict(default=False, type='bool'),
assign_public_ip=dict(default=False, type='bool')
) )
) )